Browse Source

Recipe updating now disallows pos users from editing certain data.

Lee Morgan 5 năm trước cách đây
mục cha
commit
9ce2d46204
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      controllers/recipeData.js

+ 6 - 3
controllers/recipeData.js

@@ -64,9 +64,12 @@ module.exports = {
     updateRecipe: function(req, res){
         Recipe.findOne({_id: req.body.id})
             .then((recipe)=>{
-                recipe.name = req.body.name;
-                recipe.price = req.body.price;
-                recipe.category = req.body.category;
+
+                if(merchant.pos === "none"){
+                    recipe.name = req.body.name;
+                    recipe.price = req.body.price;
+                    recipe.category = req.body.category;
+                }
                 recipe.ingredients = req.body.ingredients;
 
                 return recipe.save();