Skip to content

Commit 08c63b6

Browse files
chore: consolidate exports
1 parent 9cb670e commit 08c63b6

File tree

1 file changed

+3
-8
lines changed
  • apps/dojo/src/app/api/copilotkit/[integrationId]

1 file changed

+3
-8
lines changed

apps/dojo/src/app/api/copilotkit/[integrationId]/route.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,13 @@ async function buildAppForIntegration(integrationId: string) {
4646
return app;
4747
}
4848

49-
export const GET = async (request: Request) => {
49+
const requestHandler = async (request: Request) => {
5050
const integrationId = extractIntegrationIdFromUrl(request.url);
5151
if (!integrationId) return new Response("Integration not found", { status: 404 });
5252
const app = await buildAppForIntegration(integrationId);
5353
if (!app) return new Response("Integration not found", { status: 404 });
5454
return handle(app)(request);
5555
};
5656

57-
export const POST = async (request: Request) => {
58-
const integrationId = extractIntegrationIdFromUrl(request.url);
59-
if (!integrationId) return new Response("Integration not found", { status: 404 });
60-
const app = await buildAppForIntegration(integrationId);
61-
if (!app) return new Response("Integration not found", { status: 404 });
62-
return handle(app)(request);
63-
};
57+
export const GET = requestHandler;
58+
export const POST = requestHandler;

0 commit comments

Comments
 (0)