feat: search customer now cover more field

This commit is contained in:
Methapon Metanipat 2024-10-25 12:02:02 +07:00
parent 9f8914e5c3
commit 3cbc157028
2 changed files with 3 additions and 0 deletions

View file

@ -195,6 +195,7 @@ export class CustomerBranchController extends Controller {
) {
const where = {
OR: queryOrNot<Prisma.CustomerBranchWhereInput[]>(query, [
{ customerName: { contains: query } },
{ registerName: { contains: query } },
{ registerNameEN: { contains: query } },
{ email: { contains: query } },

View file

@ -168,6 +168,8 @@ export class CustomerController extends Controller {
OR: queryOrNot<Prisma.CustomerWhereInput[]>(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 } } } },