瀏覽代碼

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