refactor: only query if have
This commit is contained in:
parent
7bd9756e5d
commit
213ec28565
1 changed files with 26 additions and 24 deletions
|
|
@ -152,7 +152,8 @@ export class CustomerBranchController extends Controller {
|
|||
@Query() pageSize: number = 30,
|
||||
) {
|
||||
const where = {
|
||||
OR: [
|
||||
OR: query
|
||||
? [
|
||||
{ registerName: { contains: query } },
|
||||
{ registerNameEN: { contains: query } },
|
||||
{ email: { contains: query } },
|
||||
|
|
@ -175,7 +176,8 @@ export class CustomerBranchController extends Controller {
|
|||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
]
|
||||
: undefined,
|
||||
AND: {
|
||||
customer: isSystem(req.user)
|
||||
? undefined
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue