Erwin Jacimino 6 hónapja
szülő
commit
d761d50d52
1 módosított fájl, 5 hozzáadás és 0 törlés
  1. 5 0
      public/main/js/service/product.js

+ 5 - 0
public/main/js/service/product.js

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