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