diff --git a/apps/frontend-mobile/services/products.ts b/apps/frontend-mobile/services/products.ts index 9da3168..f30d2d3 100644 --- a/apps/frontend-mobile/services/products.ts +++ b/apps/frontend-mobile/services/products.ts @@ -105,10 +105,11 @@ export async function getParapharmacyBrands(): Promise { export async function getProduct(source: string, id: string): Promise { try { - // Use different endpoint for parapharmacy products - const endpoint = source === 'parapharmacy' - ? `/products/parapharmacy/${id}` - : `/products/${source}/${id}`; + // Use parapharmacy endpoint for all non-CIMA sources + const isCima = source === 'cima'; + const endpoint = isCima + ? `/products/${source}/${id}` + : `/products/parapharmacy/${id}`; const { data } = await api.get(endpoint); return data; diff --git a/apps/frontend/src/views/ProductView.jsx b/apps/frontend/src/views/ProductView.jsx index 64554ea..378dfdc 100644 --- a/apps/frontend/src/views/ProductView.jsx +++ b/apps/frontend/src/views/ProductView.jsx @@ -17,10 +17,11 @@ export default function ProductView({ source, id, onBack }) { setError(null); setPharmacies([]); try { - // Use different endpoint for parapharmacy products - const apiUrl = source === 'parapharmacy' - ? `/api/products/parapharmacy/${id}` - : `/api/products/${source}/${id}`; + // Use parapharmacy endpoint for all non-CIMA sources + const isCima = source === 'cima'; + const apiUrl = isCima + ? `/api/products/${source}/${id}` + : `/api/products/parapharmacy/${id}`; const response = await fetch(apiUrl); if (!response.ok) {