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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user