Преглед изворни кода

Fix recipes not updating on frontend with "update recipes"

Lee Morgan пре 6 година
родитељ
комит
1c077bad78
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      controllers/home.js
  2. 1 1
      views/recipesPage/recipes.js

+ 1 - 1
controllers/home.js

@@ -156,7 +156,7 @@ module.exports = {
         Merchant.findOne({_id: req.session.user})
             .populate("recipes")
             .then((merchant)=>{
-                axios.get(`https://apisandbox.dev.clover.com/v3/merchants/${req.session.user}/items?access_token=${token}`)
+                axios.get(`https://apisandbox.dev.clover.com/v3/merchants/${merchant.posId}/items?access_token=${token}`)
                     .then((result)=>{
                         let deletedRecipes = merchant.recipes.slice();
                         for(let i = 0; i < result.data.elements.length; i++){

+ 1 - 1
views/recipesPage/recipes.js

@@ -49,7 +49,7 @@ let recipesObj = {
         axios.get("/merchant/recipes/update")
             .then((result)=>{
                 merchant = result.data.merchant;
-                this.displayRecipes();
+                this.populateRecipes();
                 banner.createNotification("Your recipes have been updated successfully");
                 if(result.data.count > 0){
                     banner.createError(`You have ${result.data.count} recipes with no ingredients.  Please update them.`);