mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Fix: only filter by string or number properties for filter pipe (#7699)
This commit is contained in:
parent
66a8057e31
commit
8e555cce9e
@ -10,11 +10,16 @@ export class FilterPipe implements PipeTransform {
|
||||
if (!searchText) return items
|
||||
|
||||
return items.filter((item) => {
|
||||
return Object.keys(item).some((key) => {
|
||||
return String(item[key])
|
||||
.toLowerCase()
|
||||
.includes(searchText.toLowerCase())
|
||||
})
|
||||
return Object.keys(item)
|
||||
.filter(
|
||||
(key) =>
|
||||
typeof item[key] === 'string' || typeof item[key] === 'number'
|
||||
)
|
||||
.some((key) => {
|
||||
return String(item[key])
|
||||
.toLowerCase()
|
||||
.includes(searchText.toLowerCase())
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user