Skip to content

Commit

Permalink
enable searching by item/task id
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Feb 28, 2024
1 parent a8af508 commit ff7fd2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/item-search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function ItemSearch({
if (nameFilter.length === 0) {
return true;
}
return task.name.toLowerCase().includes(nameFilter.toLowerCase());
return task.name.toLowerCase().includes(nameFilter.toLowerCase()) || task.id === nameFilter;
}).map(task => {
return {
...task,
Expand Down
4 changes: 4 additions & 0 deletions src/modules/item-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const itemSearch = (items, searchString) => {
{
name: 'normalizedName',
weight: 0.9
},
{
name: 'id',
weight: 1
}
],
threshold: 0.3,
Expand Down

0 comments on commit ff7fd2b

Please sign in to comment.