fix(checkout-stock-recheck): checkout insufficient stock error still appears after cart sync fix

This commit is contained in:
Deploy
2026-08-26 20:33:55 +02:00
parent aaa802378b
commit a73b1a9004
9 changed files with 73 additions and 23 deletions

View File

@@ -269,5 +269,13 @@ export async function POST(request: NextRequest) {
return NextResponse.json(UNAUTHORIZED, { status: 401 });
}
if (!backendRes.ok) {
const message = await readErrorMessage(backendRes, 'Error al procesar el pedido');
return NextResponse.json(
{ error: { code: 'CHECKOUT_FAILED', message } },
{ status: backendRes.status },
);
}
return NextResponse.json(payload, { status: backendRes.status });
}