diff --git a/frontend/app/api/products/[id]/route.ts b/frontend/app/api/products/[id]/route.ts index 47bd1a9b..08ab4440 100644 --- a/frontend/app/api/products/[id]/route.ts +++ b/frontend/app/api/products/[id]/route.ts @@ -3,10 +3,11 @@ import { getAuthHeaders } from '../../../../lib/auth-headers'; const API_BASE = process.env.NEXT_PUBLIC_API_URL_INTERNAL || 'http://recipe-api:8080'; -export async function PATCH(req: NextRequest, { params }: { params: { id: string } }) { +export async function PATCH(req: NextRequest, { params }: { params: Promise<{ id: string }> }) { + const { id } = await params; const authHeaders = await getAuthHeaders(); const body = await req.json(); - const res = await fetch(`${API_BASE}/api/products/${params.id}`, { + const res = await fetch(`${API_BASE}/api/products/${id}`, { method: 'PATCH', headers: { 'Content-Type': 'application/json', ...authHeaders }, body: JSON.stringify(body),