diff --git a/README.md b/README.md index c1f3528..5d9ce70 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ A notes app built using: * Link notes by tags. -* Persist Notes using the localStorage API. +* Persist Notes and Tags using the localStorage API. * Search for notes by note title or content. diff --git a/src/stores/notes.js b/src/stores/notes.js index cd3a965..9d28ac6 100644 --- a/src/stores/notes.js +++ b/src/stores/notes.js @@ -59,16 +59,15 @@ export const useNotesStore = defineStore("notes", { }, deleteTag(id) { - const note = this.notes.filter((note) => { + this.notes.filter((note) => { note.tags.find((tag) => tag.id === id); note.tags = note.tags.filter((tag) => { return tag.id !== id; }); - - this.tags = this.tags.filter((tag) => { - return tag.id !== id; - }); + }); + this.tags = this.tags.filter((tag) => { + return tag.id !== id; }); }, },