1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 13:29:56 +00:00

Add an error when creating a recipe with no bags

This commit is contained in:
Jeremy Ruston 2024-01-26 14:42:43 +00:00
parent f5fdd79c7f
commit 62b2fe3e2f

View File

@ -186,6 +186,9 @@ SqlTiddlerStore.prototype.createRecipe = function(recipename,bagnames,descriptio
if(validationBagNames) {
return {message: validationBagNames};
}
if(bagnames.length === 0) {
return {message: "Recipes must contain at least one bag"};
}
this.sqlTiddlerDatabase.createRecipe(recipename,bagnames,description);
this.saveEntityStateTiddler({
title: "recipes/" + recipename,