From 7d7c34bcb126ab88b9fc313da8ca2147c3330d6e Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 12 Mar 2026 19:12:44 -0500 Subject: [PATCH] docker fixes --- src/app/api/reports/[id]/export/route.ts | 7 ++++--- src/app/api/reports/[id]/route.ts | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/api/reports/[id]/export/route.ts b/src/app/api/reports/[id]/export/route.ts index e26bc20..d2dfd98 100644 --- a/src/app/api/reports/[id]/export/route.ts +++ b/src/app/api/reports/[id]/export/route.ts @@ -7,8 +7,9 @@ import { getToken } from "next-auth/jwt"; export async function POST( req: Request, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { + const { id } = await params; const session = await getServerSession(authOptions); // We need the raw access token from JWT for Google API @@ -19,7 +20,7 @@ export async function POST( } const report = await prisma.report.findUnique({ - where: { id: params.id, userId: session.user.id }, + where: { id, userId: session.user.id }, include: { tasks: true, user: true }, }); @@ -45,7 +46,7 @@ export async function POST( // Update report status to SUBMITTED await prisma.report.update({ - where: { id: params.id }, + where: { id }, data: { status: 'SUBMITTED' } }); diff --git a/src/app/api/reports/[id]/route.ts b/src/app/api/reports/[id]/route.ts index f51a6fc..5d3e08e 100644 --- a/src/app/api/reports/[id]/route.ts +++ b/src/app/api/reports/[id]/route.ts @@ -6,8 +6,9 @@ import { prisma } from "@/lib/prisma"; // PATCH /api/reports/[id] - Update report status or manager export async function PATCH( req: Request, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { + const { id } = await params; const session = await getServerSession(authOptions); if (!session) { @@ -17,7 +18,7 @@ export async function PATCH( const { status, managerName } = await req.json(); const report = await prisma.report.update({ - where: { id: params.id, userId: session.user.id }, + where: { id, userId: session.user.id }, data: { status, managerName }, }); @@ -27,8 +28,9 @@ export async function PATCH( // GET /api/reports/[id] - Fetch a specific report export async function GET( req: Request, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { + const { id } = await params; const session = await getServerSession(authOptions); if (!session) { @@ -36,7 +38,7 @@ export async function GET( } const report = await prisma.report.findUnique({ - where: { id: params.id }, + where: { id }, include: { tasks: true }, });