fix: branch under headquarter display condition
This commit is contained in:
parent
2151123897
commit
0d41f60829
1 changed files with 3 additions and 1 deletions
|
|
@ -285,7 +285,7 @@ export class BranchController extends Controller {
|
||||||
branch: tree
|
branch: tree
|
||||||
? {
|
? {
|
||||||
where: {
|
where: {
|
||||||
AND: { OR: permissionCond(req.user, true) },
|
AND: { OR: permissionCond(req.user) },
|
||||||
OR: [
|
OR: [
|
||||||
{ nameEN: { contains: query } },
|
{ nameEN: { contains: query } },
|
||||||
{ name: { contains: query } },
|
{ name: { contains: query } },
|
||||||
|
|
@ -321,6 +321,7 @@ export class BranchController extends Controller {
|
||||||
@Get("{branchId}")
|
@Get("{branchId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
async getBranchById(
|
async getBranchById(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
@Path() branchId: string,
|
@Path() branchId: string,
|
||||||
@Query() includeSubBranch?: boolean,
|
@Query() includeSubBranch?: boolean,
|
||||||
@Query() includeContact?: boolean,
|
@Query() includeContact?: boolean,
|
||||||
|
|
@ -333,6 +334,7 @@ export class BranchController extends Controller {
|
||||||
createdBy: true,
|
createdBy: true,
|
||||||
updatedBy: true,
|
updatedBy: true,
|
||||||
branch: includeSubBranch && {
|
branch: includeSubBranch && {
|
||||||
|
where: { AND: { OR: permissionCond(req.user) } },
|
||||||
include: {
|
include: {
|
||||||
province: true,
|
province: true,
|
||||||
district: true,
|
district: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue