fix: map imageUrl from backend to frontend image field
This commit is contained in:
1 parent
cd17a532d9
commit
2103b105ac
1 file changed
+3
-3
@@ -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, []),
|
||||
|
||||
Reference in new issue
Block a user