restrict employee search to first and last name fields only #81

Merged
vikas.nale merged 1 commits from pramod_Bug#150 into Issue_May_2W 2025-05-08 10:15:07 +00:00
Showing only changes of commit 99caaa1704 - Show all commits

View File

@ -49,11 +49,10 @@ const EmployeeList = () => {
if (!employeeList.length) return;
const results = employeeList.filter((item) =>
Object.values(item).some(
(field) => field && field.toString().toLowerCase().includes(value)
)
);
const results = employeeList.filter((item) => {
const fullName = `${item.firstName} ${item.lastName}`.toLowerCase();
return fullName.includes(value);
});
setFilteredData(results);
};