mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-02 14:29:55 +00:00
Add an error when creating a recipe with no bags
This commit is contained in:
parent
f5fdd79c7f
commit
62b2fe3e2f
@ -186,6 +186,9 @@ SqlTiddlerStore.prototype.createRecipe = function(recipename,bagnames,descriptio
|
|||||||
if(validationBagNames) {
|
if(validationBagNames) {
|
||||||
return {message: validationBagNames};
|
return {message: validationBagNames};
|
||||||
}
|
}
|
||||||
|
if(bagnames.length === 0) {
|
||||||
|
return {message: "Recipes must contain at least one bag"};
|
||||||
|
}
|
||||||
this.sqlTiddlerDatabase.createRecipe(recipename,bagnames,description);
|
this.sqlTiddlerDatabase.createRecipe(recipename,bagnames,description);
|
||||||
this.saveEntityStateTiddler({
|
this.saveEntityStateTiddler({
|
||||||
title: "recipes/" + recipename,
|
title: "recipes/" + recipename,
|
||||||
|
Loading…
Reference in New Issue
Block a user