Parcourir la source

Require all fields to be filled before continuing merchant creation process.

Lee Morgan il y a 6 ans
Parent
commit
278177ef55
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      views/merchantSetupPage/addIngredients.js

+ 5 - 0
views/merchantSetupPage/addIngredients.js

@@ -59,6 +59,11 @@ addIngredientsObj = {
             if(row.children[0].children[0].checked){
                 let quantity = row.children[3].children[0].value;
 
+                if(quantity === ""){
+                    banner.createError("Must provide a quantity for all checked ingredients");
+                    return;
+                }
+
                 if(validator.ingredient.quantity(quantity)){
                     controller.data.inventory.push({
                         ingredient: {