Explorar o código

entertransactions page updates recipes after recipe add

Lee Morgan %!s(int64=6) %!d(string=hai) anos
pai
achega
3b36d8da8a
Modificáronse 2 ficheiros con 5 adicións e 0 borrados
  1. 4 0
      views/inventoryPage/enterTransactions.js
  2. 1 0
      views/inventoryPage/recipes.js

+ 4 - 0
views/inventoryPage/enterTransactions.js

@@ -16,6 +16,10 @@ window.enterTransactionsObj = {
     populateRecipes: function(){
         let tbody = document.querySelector("#enterTransactionsAction tbody");
 
+        while(tbody.children.length > 0){
+            tbody.removeChild(tbody.firstChild);
+        }
+
         for(let recipe of merchant.recipes){
             let row = document.createElement("tr");
             row._id = recipe._id;

+ 1 - 0
views/inventoryPage/recipes.js

@@ -100,6 +100,7 @@ window.recipesObj = {
                 }else{
                     merchant.recipes.push(response.data);
 
+                    window.enterTransactionsObj.isPopulated = false;
                     this.populateRecipes();
                 }
             })