validate 0 servings in frontend

This commit is contained in:
vabene1111
2022-02-04 16:51:16 +01:00
parent 4fe5290b15
commit 7f427c2d1f

View File

@@ -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