fix(checkout-stock-recheck): checkout insufficient stock error still appears after cart sync fix
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user