Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix: only filter by string or number properties for filter pipe (#7699)

shamoon8e555cce9e56
diff --git a/src-ui/src/app/pipes/filter.pipe.ts b/src-ui/src/app/pipes/filter.pipe.ts
index d48c2ad5d..64765bd6a 100644
--- a/src-ui/src/app/pipes/filter.pipe.ts
+++ b/src-ui/src/app/pipes/filter.pipe.ts
@@ -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())
+ })
})
}
}