fix report & find commander
This commit is contained in:
parent
38bb51f491
commit
94eb53bcc9
2 changed files with 11 additions and 4 deletions
|
|
@ -1152,9 +1152,11 @@ export class ProfileController extends Controller {
|
|||
const profile = await this.profileRepo.findOne({
|
||||
where: { keycloak: request.user.sub },
|
||||
});
|
||||
|
||||
const posMaster = await this.posMasterRepo.findOne({
|
||||
where: { current_holderId: profile?.id },
|
||||
where: {
|
||||
current_holderId: profile?.id,
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
},
|
||||
});
|
||||
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
|
||||
const orgRoot = posMaster.orgRootId;
|
||||
|
|
@ -1870,7 +1872,10 @@ export class ProfileController extends Controller {
|
|||
});
|
||||
|
||||
const posMaster = await this.posMasterRepo.findOne({
|
||||
where: { current_holderId: profile?.id },
|
||||
where: {
|
||||
current_holderId: profile?.id,
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
},
|
||||
});
|
||||
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
|
||||
const orgRoot = posMaster.orgRootId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue