Просмотр исходного кода

Didn't commit everything in the previous commit

Lee Morgan 5 лет назад
Родитель
Сommit
16a8eb180d

+ 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(()=>{