Просмотр исходного кода

Recipe updating now disallows pos users from editing certain data.

Lee Morgan 5 лет назад
Родитель
Сommit
9ce2d46204
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      controllers/recipeData.js

+ 6 - 3
controllers/recipeData.js

@@ -64,9 +64,12 @@ module.exports = {
     updateRecipe: function(req, res){
     updateRecipe: function(req, res){
         Recipe.findOne({_id: req.body.id})
         Recipe.findOne({_id: req.body.id})
             .then((recipe)=>{
             .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;
                 recipe.ingredients = req.body.ingredients;
 
 
                 return recipe.save();
                 return recipe.save();