Prechádzať zdrojové kódy

entertransactions page updates recipes after recipe add

Lee Morgan 6 rokov pred
rodič
commit
3b36d8da8a

+ 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();
                 }
             })