Skip to content

Commit

Permalink
feat : filter by label added
Browse files Browse the repository at this point in the history
  • Loading branch information
t007rushi committed Apr 7, 2022
1 parent cb9086a commit 3ab4337
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils/getFilterbylabel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const filterbyLabels = (state, notes) => {
if (state.tags.length !== 0) {
return notes.filter(
(item) =>
item.Note.labels.filter((tag) => state.tags.includes(tag)).length > 0
);
}
return notes;
};

0 comments on commit 3ab4337

Please sign in to comment.