This commit is contained in:
1 parent
2c47e35153
commit
b260d5f6d3
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const baseURL = typeof window !== 'undefined' ? '/api' : (process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4001/api');
|
||||
const baseURL = typeof window !== 'undefined' ? '/api' : (process.env.NEXT_PUBLIC_API_URL || '/api');
|
||||
|
||||
const api = axios.create({
|
||||
baseURL,
|
||||
|
||||
@@ -56,7 +56,7 @@ export class ProductService {
|
||||
onSetOfAction: data.onSetOfAction,
|
||||
optimisticTemplate: data.optimisticTemplate,
|
||||
feedingAdvice: data.feedingAdvice,
|
||||
image: data.imageUrl?.startsWith('http') ? data.imageUrl : data.imageUrl ? `http://localhost:4001${data.imageUrl}` : data.image,
|
||||
image: data.imageUrl?.startsWith('http') ? data.imageUrl : data.imageUrl ? `/api${data.imageUrl}` : data.image,
|
||||
|
||||
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) || [],
|
||||
|
||||
Reference in new issue
Block a user