|
@@ -55,6 +55,11 @@ async function getProducts(token){
|
|
|
throw new Error(errorData.message || `Error del servidor: ${response.status}`);
|
|
throw new Error(errorData.message || `Error del servidor: ${response.status}`);
|
|
|
}
|
|
}
|
|
|
const data = await response.json();
|
|
const data = await response.json();
|
|
|
|
|
+ data.products.map(product => {
|
|
|
|
|
+ if (product.promotion) {
|
|
|
|
|
+ product.price = product.promotion.price;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
return data.products;
|
|
return data.products;
|
|
|
}
|
|
}
|
|
|
|
|
|