Procházet zdrojové kódy

Update price of new recipes to convert on the frontend.

Lee Morgan před 5 roky
rodič
revize
68fe813fad

+ 1 - 1
controllers/recipeData.js

@@ -23,7 +23,7 @@ module.exports = {
         let recipe = new Recipe({
             merchant: res.locals.merchant._id,
             name: req.body.name,
-            price: Math.round(req.body.price * 100),
+            price: req.body.price,
             ingredients: req.body.ingredients
         });
 

+ 1 - 1
views/dashboardPage/js/sidebars/newRecipe.js

@@ -56,7 +56,7 @@ let newRecipe = {
     submit: function(){
         let data = {
             name: document.getElementById("newRecipeName").value,
-            price: document.getElementById("newRecipePrice").value,
+            price: parseInt(document.getElementById("newRecipePrice").value * 100),
             ingredients: []
         };