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{customer.id}. {customer.name}
+{customer.lan_id}. {customer.name}
diff --git a/resources/js/Pages/Dashboard.tsx b/resources/js/Pages/Dashboard.tsx index 04b8637..1f02cc1 100644 --- a/resources/js/Pages/Dashboard.tsx +++ b/resources/js/Pages/Dashboard.tsx @@ -11,6 +11,7 @@ interface CustomerProps { name: string group_id: string, is_group: boolean + lan_id: number }], }; @@ -19,6 +20,7 @@ type Customer = { name: string group_id: string, is_group: boolean + lan_id: number }; @@ -34,7 +36,7 @@ export default function Dashboard({ customers }: CustomerProps) { setSearchItem(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); @@ -80,8 +82,8 @@ export default function Dashboard({ customers }: CustomerProps) {{customer.name}
} - {! customer.is_group &&{customer.id}. {customer.name}
} + {! customer.lan_id &&{customer.name}
} + {customer.lan_id &&{customer.lan_id}. {customer.name}
}