add tags filter in LibraryList & LibraryMap
This commit is contained in:
+7
-1
@@ -124,10 +124,16 @@ export function searchInNode (search, node) {
|
||||
if (key === 'authors') {
|
||||
match = node[key].some(author => author.name.toLowerCase().includes(search))
|
||||
} else {
|
||||
console.log(node[key].toLowerCase(), search)
|
||||
match = node[key].toLowerCase().includes(search)
|
||||
}
|
||||
if (match) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
export function tagsInNode (tags, nodeTags) {
|
||||
if (tags.length === 0) return true
|
||||
if (!nodeTags || nodeTags.length === 0) return false
|
||||
return tags.every(tag => nodeTags.some(nodeTag => nodeTag.name === tag))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user