fix: use parapharmacy endpoint for all non-CIMA sources
- ProductView now checks if source is 'cima' to decide endpoint - All other sources (seed, promofarma, docmorris, primor) use parapharmacy endpoint - Same fix applied to mobile getProduct function Before: only 'parapharmacy' source used parapharmacy endpoint After: all non-CIMA sources use parapharmacy endpoint
This commit is contained in:
@@ -105,10 +105,11 @@ export async function getParapharmacyBrands(): Promise<string[]> {
|
||||
|
||||
export async function getProduct(source: string, id: string): Promise<Product | null> {
|
||||
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<Product>(endpoint);
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user