fix: recherche produit par SKU Shopify avec fallback sans suffixe (30827-dessus → 30827)
This commit is contained in:
@@ -47,12 +47,11 @@ export async function GET(req: NextRequest) {
|
||||
const ugs = (row[2] ?? '').trim()
|
||||
|
||||
// Le nom de fichier contient l'UGS (ex: "30827-dessus" contient "30827")
|
||||
// Les UGS étant uniques, un simple contains suffit
|
||||
const refLower = ref.toLowerCase()
|
||||
const ugsLower = ugs.toLowerCase()
|
||||
const isMatch = ugs && refLower.includes(ugsLower)
|
||||
const isMatch = ugs && shopifyId && refLower.includes(ugsLower)
|
||||
|
||||
if (isMatch && shopifyId) {
|
||||
if (isMatch) {
|
||||
const title = (row[3] ?? '').trim() // col D = Nom
|
||||
return NextResponse.json({ found: true, shopifyId, title })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user