Erwin Jacimino пре 6 месеци
родитељ
комит
d761d50d52
1 измењених фајлова са 5 додато и 0 уклоњено
  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;
 }