diff --git a/resources/js/Pages/CustomerGroups.tsx b/resources/js/Pages/CustomerGroups.tsx index 327b983..3315c15 100644 --- a/resources/js/Pages/CustomerGroups.tsx +++ b/resources/js/Pages/CustomerGroups.tsx @@ -12,6 +12,7 @@ interface CustomerProps { name: string customer_group_id: string, is_in_group: boolean + lan_id: number }], }; @@ -20,7 +21,7 @@ type Customer = { name: string customer_group_id: string, is_in_group: boolean - + lan_id: number }; interface CustomerGroupProps { @@ -32,6 +33,7 @@ interface CustomerGroupProps { name: string customer_group_id: string, is_in_group: boolean + lan_id: number }], }] }; @@ -44,6 +46,7 @@ type CustomerGroup = { name: string customer_group_id: string, is_in_group: boolean + lan_id: number }], }; @@ -86,7 +89,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps setSearchItemCustomers(searchTerm) const filteredItems = customers.filter((customer) => - customer.name.toLowerCase().includes(searchTerm.toLowerCase()) + customer.name.toLowerCase().includes(searchTerm.toLowerCase()) || String(customer.lan_id).includes(searchTerm) ); setFilteredCustomers(filteredItems); @@ -161,7 +164,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps setSearchItemCustomersAddToGroup(searchTerm) const filteredItems = customers.filter((customer) => - customer.name.toLowerCase().includes(searchTerm.toLowerCase()) + customer.name.toLowerCase().includes(searchTerm.toLowerCase()) || String(customer.lan_id).includes(searchTerm) ); setFilteredCustomersAddToGroup(filteredItems); @@ -211,7 +214,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps .map( customer => { return })} @@ -228,7 +231,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps .filter((filteredCustomer) => checkboxesAddToGroup.includes("" + filteredCustomer.id)) .map( customer => { return

- {customer.id}. {customer.name} + {customer.lan_id}. {customer.name}

})} @@ -281,7 +284,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps .map( customer => { return })} @@ -298,7 +301,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps .filter((filteredCustomer) => checkboxes.includes("" + filteredCustomer.id)) .map( customer => { return

- {customer.id}. {customer.name} + {customer.lan_id}. {customer.name}

})} @@ -354,7 +357,7 @@ export default function CustomerGroups({groups, customers} :( CustomerGroupProps