Compare commits
18 Commits
e1fb300b87
...
8a6afa10d8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a6afa10d8 | ||
|
|
7fd7140c9c | ||
|
|
9fdb652570 | ||
|
|
e7df5b3964 | ||
|
|
ed2a684f80 | ||
|
|
d4861f202e | ||
|
|
6dd0e9ed56 | ||
|
|
108b7b424b | ||
|
|
77e2855d27 | ||
|
|
73812ba11a | ||
|
|
4a02b7aab2 | ||
|
|
6c6e240f3d | ||
|
|
9e26a608e0 | ||
|
|
d08cacad47 | ||
|
|
1ba944733c | ||
|
|
c38a50ac21 | ||
|
|
ada1d03d00 | ||
|
|
22d5d5eb50 |
@ -283,30 +283,6 @@ export async function main() {
|
|||||||
console.warn(`[Seed] Warning upserting product ${artNo}:`, err.message || err);
|
console.warn(`[Seed] Warning upserting product ${artNo}:`, err.message || err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seed ingredients
|
|
||||||
await prisma.productIngredient.deleteMany({ where: { productId: product.id } });
|
|
||||||
if (cleanIngredients) {
|
|
||||||
const parts = cleanIngredients.split(/[،,]/).map((s: string) => s.trim()).filter(Boolean);
|
|
||||||
const meaningful = parts.slice(0, 20);
|
|
||||||
for (const ing of meaningful) {
|
|
||||||
const truncated = ing.substring(0, 150);
|
|
||||||
if (truncated.length > 0) {
|
|
||||||
await prisma.productIngredient.create({
|
|
||||||
data: { productId: product.id, ingredient: truncated }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Seed symptoms
|
|
||||||
await prisma.productSymptom.deleteMany({ where: { productId: product.id } });
|
|
||||||
const symptomsList = PRODUCT_SYMPTOMS_MAP[baseSlug] || [];
|
|
||||||
for (const sym of symptomsList) {
|
|
||||||
await prisma.productSymptom.create({
|
|
||||||
data: { productId: product.id, symptom: sym }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
variantCount++;
|
variantCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user