Quellcode durchsuchen

Recipe updating now disallows pos users from editing certain data.

Lee Morgan vor 5 Jahren
Ursprung
Commit
9ce2d46204
1 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen
  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();