refactor: dry
This commit is contained in:
parent
8892e237ec
commit
a1973cf66c
1 changed files with 5 additions and 4 deletions
|
|
@ -182,12 +182,13 @@ export class BranchController extends Controller {
|
|||
AND: {
|
||||
headOfficeId: headOfficeId ?? (filter === "head" || tree ? null : undefined),
|
||||
NOT: { headOfficeId: filter === "sub" && !headOfficeId ? null : undefined },
|
||||
zipCode,
|
||||
},
|
||||
OR: [
|
||||
{ nameEN: { contains: query }, zipCode },
|
||||
{ name: { contains: query }, zipCode },
|
||||
{ email: { contains: query }, zipCode },
|
||||
{ telephoneNo: { contains: query }, zipCode },
|
||||
{ nameEN: { contains: query } },
|
||||
{ name: { contains: query } },
|
||||
{ email: { contains: query } },
|
||||
{ telephoneNo: { contains: query } },
|
||||
],
|
||||
} satisfies Prisma.BranchWhereInput;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue