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

Update price of new recipes to convert on the frontend.

Lee Morgan пре 5 година
родитељ
комит
68fe813fad
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      controllers/recipeData.js
  2. 1 1
      views/dashboardPage/js/sidebars/newRecipe.js

+ 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: []
         };