mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Fixed filter search.
This commit is contained in:
parent
726212120f
commit
99559c2b35
1 changed files with 16 additions and 11 deletions
|
|
@ -28,17 +28,22 @@ export function useWebsiteValues({
|
||||||
const getSearch = (type: string, value: string) => {
|
const getSearch = (type: string, value: string) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
const values = names[type];
|
const values = names[type];
|
||||||
return (
|
|
||||||
Object.keys(values)
|
if (values) {
|
||||||
.reduce((arr: string[], key: string) => {
|
return (
|
||||||
if (values[key].toLowerCase().includes(value.toLowerCase())) {
|
Object.keys(values)
|
||||||
return arr.concat(key);
|
.reduce((arr: string[], key: string) => {
|
||||||
}
|
if (values[key].toLowerCase().includes(value.toLowerCase())) {
|
||||||
return arr;
|
return arr.concat(key);
|
||||||
}, [])
|
}
|
||||||
.slice(0, 5)
|
return arr;
|
||||||
.join(',') || value
|
}, [])
|
||||||
);
|
.slice(0, 5)
|
||||||
|
.join(',') || value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue