added data validation on name and description length

This commit is contained in:
smilerz
2021-03-18 16:03:13 -05:00
parent fd09ae1510
commit ce8524b247

View File

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