mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 15:25:41 +01:00
Fix: only filter by string or number properties for filter pipe (#7699)
This commit is contained in:
parent
66a8057e31
commit
8e555cce9e
1 changed files with 10 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue