diff --git a/frontend/application/lib/services/productService.ts b/frontend/application/lib/services/productService.ts index 14fb761a..5311b20c 100644 --- a/frontend/application/lib/services/productService.ts +++ b/frontend/application/lib/services/productService.ts @@ -46,10 +46,10 @@ export class ProductService { onSetOfAction: data.onSetOfAction, optimisticTemplate: data.optimisticTemplate, feedingAdvice: data.feedingAdvice, - image: data.image, + image: data.imageUrl?.startsWith('http') ? data.imageUrl : data.imageUrl ? `http://localhost:4001${data.imageUrl}` : data.image, - main_ingredients: data.ingredients?.map((i: any) => i.ingredient) || [], - symptoms: data.symptoms?.map((s: any) => s.symptom) || [], + main_ingredients: data.ingredientList?.map((i: any) => i.ingredient) || data.ingredients?.split(/[،,-]/).map((s: string) => s.trim()).filter(Boolean) || [], + symptoms: data.symptoms?.map((s: any) => s.symptom || s) || [], keyBenefits: safeParse(data.keyBenefits, []), expectedResults: safeParse(data.expectedResults, []), benefitsList: safeParse(data.benefitsList, []),