diff --git a/app/api/v3/projects/[project_id]/notices/route.ts b/app/api/v3/notices/route.ts similarity index 95% rename from app/api/v3/projects/[project_id]/notices/route.ts rename to app/api/v3/notices/route.ts index fba29e06..725f1c8a 100644 --- a/app/api/v3/projects/[project_id]/notices/route.ts +++ b/app/api/v3/notices/route.ts @@ -85,7 +85,8 @@ async function POST(request: NextRequest) { const customNanoid = customAlphabet(urlAlphabet, 21); // assuming airbroke frontend is deployed alongside collector - const responseJSON = { id: customNanoid, url: `${getServerHostname(request)}/projects/${project.id}/notices` }; + const responseJSON = { id: customNanoid(), url: `${getServerHostname(request)}/projects/${project.id}/notices` }; + console.log(responseJSON); // Log the response JSON return NextResponse.json(responseJSON, { status: 201 }); } diff --git a/components/ConfirmationDialog.tsx b/components/ConfirmationDialog.tsx index 5141ee6f..0c79cb9d 100644 --- a/components/ConfirmationDialog.tsx +++ b/components/ConfirmationDialog.tsx @@ -11,7 +11,7 @@ export default function ConfirmationDialog({ title, body, btnTitle, - projectConfirmationAction, + projectConfirmationAction, // server action imported from _actions and passed down as prop }: { project: project; title?: string; diff --git a/next.config.js b/next.config.js index 9e33f2b6..8a875c60 100644 --- a/next.config.js +++ b/next.config.js @@ -9,7 +9,15 @@ const nextConfig = { return [ { source: '/api/v3/projects/:project_id/create-notice', - destination: '/api/v3/projects/:project_id/notices', + destination: '/api/v3/notices', + }, + { + source: '/api/v3/projects/:project_id/notices', + destination: '/api/v3/notices', + }, + { + source: '/notifier_api/v2/notices', + destination: '/api/v3/notices', }, ]; },