فهرست منبع

fix promo price

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;
 }