diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 0d28822d..a0bcfe25 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -1681,7 +1681,7 @@ export class ProfileController extends Controller { relations: ["current_holder", "current_holder.posLevel"], }); if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง"); - if (posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null == "DEPUTY") { + if ((posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null) == "DEPUTY") { posMaster = await this.posMasterRepo.findOne({ where: { orgRoot: { isDeputy: true }, @@ -1690,7 +1690,7 @@ export class ProfileController extends Controller { }, }); return new HttpSuccess({ data: [], total: 0 }); - } else if (posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null == "GOVERNOR") { + } else if ((posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null) == "GOVERNOR") { return new HttpSuccess({ data: [], total: 0 }); } let condition: any = { @@ -1722,6 +1722,8 @@ export class ProfileController extends Controller { condition.isDirector = true; conditionNow.isDirector = true; } + console.log(condition); + console.log(conditionNow); if (body.isAct == true) { const [lists, total] = await AppDataSource.getRepository(viewDirectorActing) .createQueryBuilder("viewDirectorActing")