Browse Source

entertransactions page updates recipes after recipe add

Lee Morgan 6 years ago
parent
commit
3b36d8da8a
2 changed files with 5 additions and 0 deletions
  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();
                 }
             })