diff --git a/src/controllers/customer-controller.ts b/src/controllers/customer-controller.ts index ebcd031..4da54e8 100644 --- a/src/controllers/customer-controller.ts +++ b/src/controllers/customer-controller.ts @@ -136,13 +136,17 @@ export class CustomerController extends Controller { @Get() async list( + @Query() customerType?: CustomerType, @Query() query: string = "", @Query() page: number = 1, @Query() pageSize: number = 30, @Query() includeBranch: boolean = false, ) { const where = { - OR: [{ customerName: { contains: query } }, { customerNameEN: { contains: query } }], + OR: [ + { customerName: { contains: query }, customerType }, + { customerNameEN: { contains: query }, customerType }, + ], } satisfies Prisma.CustomerWhereInput; const [result, total] = await prisma.$transaction([