Widened Search

This commit is contained in:
Kim 2023-08-29 11:34:35 +02:00
parent 2f403a9819
commit 6964f49b8b
2 changed files with 10 additions and 3 deletions

View File

@ -23,7 +23,12 @@ const filterData = (
return data.filter(
(installation) =>
installation.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
installation.location.toLowerCase().includes(searchQuery.toLowerCase())
installation.location.toLowerCase().includes(searchQuery.toLowerCase()) ||
installation.region.toLowerCase().includes(searchQuery.toLowerCase()) ||
installation.information.toLowerCase().includes(searchQuery.toLowerCase())||
installation.orderNumbers.includes(searchQuery.toLowerCase())||
installation.country.toLowerCase().includes(searchQuery.toLowerCase())||
(installation.detail && installation.detail.toLowerCase().includes(searchQuery.toLowerCase()))
);
}
return data;

View File

@ -21,8 +21,10 @@ const getPathWithoutId = (path?: string) => {
const filterData = (searchQuery: string, data: I_User[] | undefined) => {
if (data) {
return data.filter((installation) =>
installation.name.toLowerCase().includes(searchQuery.toLowerCase())
return data.filter((user) =>
user.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
user.email.toLowerCase().includes(searchQuery.toLowerCase()) ||
user.information.toLowerCase().includes(searchQuery.toLowerCase())
);
}
return data;