mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
added data validation on name and description length
This commit is contained in:
@@ -357,6 +357,14 @@
|
||||
})
|
||||
},
|
||||
importRecipe: function () {
|
||||
if (this.recipe_data.name.length > 128) {
|
||||
this.makeToast(gettext('Error'), gettext('Recipe name is longer than 128 characters'), 'danger')
|
||||
return;
|
||||
}
|
||||
if (this.recipe_data.description.length > 512) {
|
||||
this.makeToast(gettext('Error'), gettext('Recipe description is longer than 512 characters'), 'danger')
|
||||
return;
|
||||
}
|
||||
if (this.importing_recipe) {
|
||||
this.makeToast(gettext('Error'), gettext('Already importing the selected recipe, please wait!'), 'danger')
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user