From 7f427c2d1f5935af775e9398cb99f53daeb58085 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 4 Feb 2022 16:51:16 +0100 Subject: [PATCH] validate 0 servings in frontend --- vue/src/apps/RecipeEditView/RecipeEditView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vue/src/apps/RecipeEditView/RecipeEditView.vue b/vue/src/apps/RecipeEditView/RecipeEditView.vue index 72378251d..547c2fbfb 100644 --- a/vue/src/apps/RecipeEditView/RecipeEditView.vue +++ b/vue/src/apps/RecipeEditView/RecipeEditView.vue @@ -736,8 +736,8 @@ export default { } this.recipe.servings = Math.floor(this.recipe.servings) // temporary fix until a proper framework for frontend input validation is established - if (this.recipe.servings === "" || isNaN(this.recipe.servings)) { - this.recipe.servings = 0 + if (this.recipe.servings === "" || isNaN(this.recipe.servings) || this.recipe.servings===0 ) { + this.recipe.servings = 1 } apiFactory