feat: add query string
This commit is contained in:
parent
0747fca92e
commit
5b6c7e7ac8
3 changed files with 23 additions and 18 deletions
|
|
@ -138,14 +138,15 @@ export class CustomerController extends Controller {
|
|||
async list(
|
||||
@Query() customerType?: CustomerType,
|
||||
@Query() query: string = "",
|
||||
@Query() status?: Status,
|
||||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() includeBranch: boolean = false,
|
||||
) {
|
||||
const where = {
|
||||
OR: [
|
||||
{ customerName: { contains: query }, customerType },
|
||||
{ customerNameEN: { contains: query }, customerType },
|
||||
{ customerName: { contains: query }, customerType, status },
|
||||
{ customerNameEN: { contains: query }, customerType, status },
|
||||
],
|
||||
} satisfies Prisma.CustomerWhereInput;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue