mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-04 21:58:54 -05:00
validate 0 servings in frontend
This commit is contained in:
@@ -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
|
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)) {
|
if (this.recipe.servings === "" || isNaN(this.recipe.servings) || this.recipe.servings===0 ) {
|
||||||
this.recipe.servings = 0
|
this.recipe.servings = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
apiFactory
|
apiFactory
|
||||||
|
|||||||
Reference in New Issue
Block a user