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: {
|
AND: {
|
||||||
headOfficeId: headOfficeId ?? (filter === "head" || tree ? null : undefined),
|
headOfficeId: headOfficeId ?? (filter === "head" || tree ? null : undefined),
|
||||||
NOT: { headOfficeId: filter === "sub" && !headOfficeId ? null : undefined },
|
NOT: { headOfficeId: filter === "sub" && !headOfficeId ? null : undefined },
|
||||||
|
zipCode,
|
||||||
},
|
},
|
||||||
OR: [
|
OR: [
|
||||||
{ nameEN: { contains: query }, zipCode },
|
{ nameEN: { contains: query } },
|
||||||
{ name: { contains: query }, zipCode },
|
{ name: { contains: query } },
|
||||||
{ email: { contains: query }, zipCode },
|
{ email: { contains: query } },
|
||||||
{ telephoneNo: { contains: query }, zipCode },
|
{ telephoneNo: { contains: query } },
|
||||||
],
|
],
|
||||||
} satisfies Prisma.BranchWhereInput;
|
} satisfies Prisma.BranchWhereInput;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue