Handle untitled note (#592)

* Leave recipe in edit mode in case of an API error

* Initialize recipe note with empty title

Fixes #586
This commit is contained in:
sephrat 2021-06-23 19:45:16 +02:00 committed by GitHub
parent 1356043257
commit 3b99a147fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ export default {
return utils.generateUniqueKey(item, index);
},
addNote() {
this.value.push({ text: "" });
this.value.push({ title: "", text: "" });
},
removeByIndex(list, index) {
list.splice(index, 1);

View File

@ -134,7 +134,6 @@ export default {
break;
case SAVE_EVENT:
this.$emit(SAVE_EVENT);
this.$emit("input", false);
break;
case JSON_EVENT:
this.$emit(JSON_EVENT);

View File

@ -233,6 +233,7 @@ export default {
async saveRecipe() {
if (this.validateRecipe()) {
let slug = await api.recipes.update(this.recipeDetails);
if(!slug) return;
if (this.fileObject) {
this.saveImage(true);