Merge pull request 'restrict employee search to first and last name fields only' (#81) from pramod_Bug#150 into Issue_May_2W

Reviewed-on: #81
This commit is contained in:
Vikas Nale 2025-05-08 10:15:07 +00:00
commit e856220173

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);
};