fix: product detail view for parapharmacy products

- Updated ProductView to use correct endpoint for parapharmacy
- Updated getProduct service to handle parapharmacy products
- Shows price, category, brand, source for parapharmacy products
- Updated labels from 'OFF' to 'Parafarmacia'
This commit is contained in:
Antoni Nuñez Romeu
2026-07-16 15:47:14 +02:00
parent 570d4ab43e
commit 3429b7e548
3 changed files with 39 additions and 25 deletions
+6 -1
View File
@@ -105,7 +105,12 @@ export async function getParapharmacyBrands(): Promise<string[]> {
export async function getProduct(source: string, id: string): Promise<Product | null> {
try {
const { data } = await api.get<Product>(`/products/${source}/${id}`);
// Use different endpoint for parapharmacy products
const endpoint = source === 'parapharmacy'
? `/products/parapharmacy/${id}`
: `/products/${source}/${id}`;
const { data } = await api.get<Product>(endpoint);
return data;
} catch (error) {
console.error('[Products] Detail error:', error);