fix: propagate Shopify 404 through upload route so client retry triggers correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 20:40:50 +02:00
parent 5e1b864ce7
commit 03770d1a76
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -26,6 +26,7 @@ export async function POST(req: NextRequest) {
return NextResponse.json(result)
} catch (err) {
const message = err instanceof Error ? err.message : 'Erreur inconnue'
return NextResponse.json({ error: message }, { status: 500 })
const status = (err as { status?: number }).status === 404 ? 404 : 500
return NextResponse.json({ error: message }, { status })
}
}