From 3cbc1570283d1a286cede55f23496a213a2bf45d Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Fri, 25 Oct 2024 12:02:02 +0700 Subject: [PATCH] feat: search customer now cover more field --- src/controllers/03-customer-branch-controller.ts | 1 + src/controllers/03-customer-controller.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/controllers/03-customer-branch-controller.ts b/src/controllers/03-customer-branch-controller.ts index 7200d19..b728785 100644 --- a/src/controllers/03-customer-branch-controller.ts +++ b/src/controllers/03-customer-branch-controller.ts @@ -195,6 +195,7 @@ export class CustomerBranchController extends Controller { ) { const where = { OR: queryOrNot(query, [ + { customerName: { contains: query } }, { registerName: { contains: query } }, { registerNameEN: { contains: query } }, { email: { contains: query } }, diff --git a/src/controllers/03-customer-controller.ts b/src/controllers/03-customer-controller.ts index b5d72f3..3bfebcf 100644 --- a/src/controllers/03-customer-controller.ts +++ b/src/controllers/03-customer-controller.ts @@ -168,6 +168,8 @@ export class CustomerController extends Controller { OR: queryOrNot(query, [ { branch: { some: { namePrefix: { contains: query } } } }, { branch: { some: { customerName: { contains: query } } } }, + { branch: { some: { registerName: { contains: query } } } }, + { branch: { some: { registerNameEN: { contains: query } } } }, { branch: { some: { firstName: { contains: query } } } }, { branch: { some: { firstNameEN: { contains: query } } } }, { branch: { some: { lastName: { contains: query } } } },