From 326af9fd480121cc98c84b89c1da3352ad0135a9 Mon Sep 17 00:00:00 2001 From: bot-hermes Date: Wed, 29 Jul 2026 12:39:08 +0000 Subject: [PATCH] fix: rename [id] to [projectId] in projects API route to resolve Next.js param conflict --- .../[domainId]/projects/{[id] => [projectId]}/route.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename apps/web/app/api/domains/[domainId]/projects/{[id] => [projectId]}/route.ts (95%) diff --git a/apps/web/app/api/domains/[domainId]/projects/[id]/route.ts b/apps/web/app/api/domains/[domainId]/projects/[projectId]/route.ts similarity index 95% rename from apps/web/app/api/domains/[domainId]/projects/[id]/route.ts rename to apps/web/app/api/domains/[domainId]/projects/[projectId]/route.ts index a7106f7..e577b83 100644 --- a/apps/web/app/api/domains/[domainId]/projects/[id]/route.ts +++ b/apps/web/app/api/domains/[domainId]/projects/[projectId]/route.ts @@ -21,11 +21,11 @@ const updateProjectSchema = z.object({ targetDate: z.string().datetime().optional().nullable(), }); -type RouteContext = { params: Promise<{ domainId: string; id: string }> }; +type RouteContext = { params: Promise<{ domainId: string; projectId: string }> }; // GET /api/domains/[domainId]/projects/[id] — Get a single project with sections, task counts, progress export const GET = withAuth(async (request: NextRequest, user, context) => { - const { domainId, id } = await context!.params; + const { domainId, projectId: id } = await context!.params; await requireWorkspaceAccess(domainId); const [project] = await db.select() @@ -77,7 +77,7 @@ export const GET = withAuth(async (request: NextRequest, user, con // PATCH /api/domains/[domainId]/projects/[id] — Update a project export const PATCH = withAuth(async (request: NextRequest, user, context) => { - const { domainId, id } = await context!.params; + const { domainId, projectId: id } = await context!.params; await requireWorkspaceAccess(domainId); try { @@ -131,7 +131,7 @@ export const PATCH = withAuth(async (request: NextRequest, user, c // DELETE /api/domains/[domainId]/projects/[id] — Soft delete a project export const DELETE = withAuth(async (request: NextRequest, user, context) => { - const { domainId, id } = await context!.params; + const { domainId, projectId: id } = await context!.params; await requireWorkspaceAccess(domainId); const [existing] = await db.select()