contact recoreds done

This commit is contained in:
Ken Yasue
2025-03-25 08:12:33 +01:00
parent c9751b058f
commit 42f2a30610
5 changed files with 66 additions and 22 deletions

View File

@ -10,6 +10,7 @@ export async function GET(request: NextRequest) {
// Get query parameters
const url = new URL(request.url);
const customerId = url.searchParams.get('customerId');
const contactType = url.searchParams.get('contactType');
const dateFrom = url.searchParams.get('dateFrom');
const dateTo = url.searchParams.get('dateTo');
@ -27,6 +28,11 @@ export async function GET(request: NextRequest) {
whereClause.customerId = customerId;
}
// Filter by contact type if provided
if (contactType) {
whereClause.contactType = contactType;
}
// Filter by date range if provided
if (dateFrom || dateTo) {
whereClause.createdAt = {};