diff --git a/src/components/CreateProject/StaffAllocation.tsx b/src/components/CreateProject/StaffAllocation.tsx index 76130e7..47d79a4 100644 --- a/src/components/CreateProject/StaffAllocation.tsx +++ b/src/components/CreateProject/StaffAllocation.tsx @@ -171,8 +171,8 @@ const StaffAllocation: React.FC = ({ allStaffs.filter((staff) => { const q = query.toLowerCase(); return ( - (staff.name.toLowerCase().includes(q) || - staff.staffId.toString().includes(q) || + (staff.name?.toLowerCase().includes(q) || + staff.staffId?.toLowerCase().includes(q) || staff.currentPosition?.toLowerCase().includes(q)) && Object.entries(filters).every(([filterKey, filterValue]) => { const staffColumnValue = staff[filterKey as keyof StaffResult];