refactor(route): update parameter handling in PATCH function for improved readability

This commit is contained in:
Nils-Johan Gynther
2026-04-19 17:37:10 +02:00
parent 2a412406e2
commit be6529f021
@@ -12,10 +12,11 @@ async function getAuthHeaders(): Promise<Record<string, string>> {
export async function PATCH( export async function PATCH(
req: Request, req: Request,
{ params }: { params: { id: string } }, { params }: { params: Promise<{ id: string }> },
) { ) {
try { try {
const productId = parseInt(params.id, 10); const { id } = await params;
const productId = parseInt(id, 10);
const body = await req.json(); const body = await req.json();
const { categoryId } = body; const { categoryId } = body;