소스 검색

Didn't commit everything in the previous commit

Lee Morgan 5 년 전
부모
커밋
16a8eb180d
3개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 1
      views/dashboardPage/bundle.js
  2. 1 1
      views/dashboardPage/js/Merchant.js
  3. 1 0
      views/dashboardPage/js/transactionDetails.js

+ 2 - 1
views/dashboardPage/bundle.js

@@ -473,7 +473,7 @@ class Merchant{
         for(let i = 0; i < transaction.recipes.length; i++){
             const recipe = transaction.recipes[i];
             for(let j = 0; j < recipe.recipe.ingredients.length; j++){
-                const ingredient = recipe.recipe.ingredients[i];
+                const ingredient = recipe.recipe.ingredients[j];
                 if(ingredients[ingredient.ingredient.id]){
                     ingredients[ingredient.ingredient.id] += ingredient.quantity * recipe.quantity;
                 }else{
@@ -3675,6 +3675,7 @@ let transactionDetails = {
                 }
             })
             .catch((err)=>{
+                console.log(err);
                 banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{

+ 1 - 1
views/dashboardPage/js/Merchant.js

@@ -346,7 +346,7 @@ class Merchant{
         for(let i = 0; i < transaction.recipes.length; i++){
             const recipe = transaction.recipes[i];
             for(let j = 0; j < recipe.recipe.ingredients.length; j++){
-                const ingredient = recipe.recipe.ingredients[i];
+                const ingredient = recipe.recipe.ingredients[j];
                 if(ingredients[ingredient.ingredient.id]){
                     ingredients[ingredient.ingredient.id] += ingredient.quantity * recipe.quantity;
                 }else{

+ 1 - 0
views/dashboardPage/js/transactionDetails.js

@@ -66,6 +66,7 @@ let transactionDetails = {
                 }
             })
             .catch((err)=>{
+                console.log(err);
                 banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{