mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-03 10:43:40 -05:00 
			
		
		
		
	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:
		@@ -55,7 +55,7 @@ export default {
 | 
				
			|||||||
      return utils.generateUniqueKey(item, index);
 | 
					      return utils.generateUniqueKey(item, index);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    addNote() {
 | 
					    addNote() {
 | 
				
			||||||
      this.value.push({ text: "" });
 | 
					      this.value.push({ title: "", text: "" });
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    removeByIndex(list, index) {
 | 
					    removeByIndex(list, index) {
 | 
				
			||||||
      list.splice(index, 1);
 | 
					      list.splice(index, 1);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -134,7 +134,6 @@ export default {
 | 
				
			|||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case SAVE_EVENT:
 | 
					        case SAVE_EVENT:
 | 
				
			||||||
          this.$emit(SAVE_EVENT);
 | 
					          this.$emit(SAVE_EVENT);
 | 
				
			||||||
          this.$emit("input", false);
 | 
					 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case JSON_EVENT:
 | 
					        case JSON_EVENT:
 | 
				
			||||||
          this.$emit(JSON_EVENT);
 | 
					          this.$emit(JSON_EVENT);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -233,6 +233,7 @@ export default {
 | 
				
			|||||||
    async saveRecipe() {
 | 
					    async saveRecipe() {
 | 
				
			||||||
      if (this.validateRecipe()) {
 | 
					      if (this.validateRecipe()) {
 | 
				
			||||||
        let slug = await api.recipes.update(this.recipeDetails);
 | 
					        let slug = await api.recipes.update(this.recipeDetails);
 | 
				
			||||||
 | 
					        if(!slug) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (this.fileObject) {
 | 
					        if (this.fileObject) {
 | 
				
			||||||
          this.saveImage(true);
 | 
					          this.saveImage(true);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user