generated from pagevamp/copilot-custom-app-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* data plotting of table * data plotting of table * integrated custom field access and save apis * fix custom field access issues * added client api * added manage page * added history popup * added sorting feature * added searching feature * added searching for all fields * added chip color variations * fix bug * added empty state fallback * fix bug * fix design issues * fix design issues * adds tooltip on disabled field * removed image if company image icon is not present * fix bugs * added enums for ProfileLinks * added enums for Permissions * removed unnecessary if/else comparisions * adds server action * fix issue with server action * fix issue with server action * added token and portalId * stringified in client component * stringified in client component * reverted from server action for now
- Loading branch information
Showing
36 changed files
with
1,228 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
COPILOT_API_KEY="" | ||
POSTGRES_PRISMA_URL="" | ||
POSTGRES_URL_NON_POOLING="" | ||
COPILOT_API_KEY="b4fa0b79be594f91a2c72c63216d45ec.6463d9dc556351b6" | ||
|
||
# Vercel Database | ||
POSTGRES_PRISMA_URL="postgres://default:2tCAVY7Npmyc@ep-morning-mountain-74331247-pooler.us-east-1.postgres.vercel-storage.com/verceldb?pgbouncer=true&connect_timeout=15" | ||
POSTGRES_URL_NON_POOLING="postgres://default:2tCAVY7Npmyc@ep-morning-mountain-74331247.us-east-1.postgres.vercel-storage.com/verceldb" | ||
|
||
# Local Database | ||
; POSTGRES_PRISMA_URL="postgresql://db:[email protected]:59004/db?schema=public" | ||
; POSTGRES_URL_NON_POOLING="postgresql://db:[email protected]:59004/db?schema=public" | ||
|
||
COPILOT_API_URL="https://api-beta.copilot.com" | ||
COPILOT_ENV="local" | ||
COPILOT_API_URL="" | ||
VERCEL_URL="localhost:3000" | ||
VERCEL_ENV="development" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { respondError } from '@/utils/common'; | ||
import { CopilotAPI } from '@/utils/copilotApiUtils'; | ||
import { NextResponse, NextRequest } from 'next/server'; | ||
import { z } from 'zod'; | ||
|
||
export async function GET(request: NextRequest) { | ||
const searchParams = request.nextUrl.searchParams; | ||
const clientId = searchParams.get('clientId'); | ||
const token = searchParams.get('token'); | ||
if (!token) { | ||
return respondError('Missing token', 422); | ||
} | ||
if (!clientId) { | ||
respondError('Missing client Id', 422); | ||
} | ||
const copilotClient = new CopilotAPI(z.string().parse(token)); | ||
try { | ||
const client = await copilotClient.getClient(z.string().parse(clientId)); | ||
|
||
return NextResponse.json({ data: client }); | ||
} catch (error) { | ||
console.log(error); | ||
return respondError('Client not found.', 404); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.