Skip to content

Commit

Permalink
Fixed Delete Tag Functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
MoustafaShaaban committed May 11, 2024
1 parent 4df4c16 commit 05ea069
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
9 changes: 4 additions & 5 deletions src/stores/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
},
},
Expand Down

0 comments on commit 05ea069

Please sign in to comment.