From b512aef63dbbb71e99cd03fc6ae3f8de2d76abc5 Mon Sep 17 00:00:00 2001 From: Ken Yasue Date: Tue, 25 Mar 2025 13:43:00 +0100 Subject: [PATCH] change customer filter to text box from select box --- .../(admin)/admin/contact-records/page.tsx | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/src/app/(admin)/admin/contact-records/page.tsx b/src/app/(admin)/admin/contact-records/page.tsx index 479f961..6cecbb8 100644 --- a/src/app/(admin)/admin/contact-records/page.tsx +++ b/src/app/(admin)/admin/contact-records/page.tsx @@ -54,7 +54,6 @@ export default function ContactRecordsList() { // State for data const [contactRecords, setContactRecords] = useState([]); - const [customers, setCustomers] = useState([]); const [pagination, setPagination] = useState({ page: initialPage, pageSize: initialPageSize, @@ -64,25 +63,6 @@ export default function ContactRecordsList() { const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); - // Fetch customers for the filter dropdown - useEffect(() => { - const fetchCustomers = async () => { - try { - const response = await fetch('/api/customers'); - if (!response.ok) { - throw new Error('Failed to fetch customers'); - } - const data = await response.json(); - setCustomers(data); - } catch (err) { - console.error('Error fetching customers:', err); - setError(err instanceof Error ? err.message : 'An error occurred'); - } - }; - - fetchCustomers(); - }, []); - // Fetch contact records with filters and pagination useEffect(() => { const fetchContactRecords = async () => { @@ -173,22 +153,17 @@ export default function ContactRecordsList() {
- + />