no message

This commit is contained in:
kittapath 2024-09-13 17:10:18 +07:00
parent 376ab804db
commit 9dca259981

View file

@ -625,23 +625,22 @@ export class OrganizationController extends Controller {
) { ) {
await new permission().PermissionList(request, "SYS_ORG"); await new permission().PermissionList(request, "SYS_ORG");
} }
if (_data.root != null) { if (orgRevision.orgRevisionIsDraft == true && orgRevision.orgRevisionIsCurrent == false) {
if (orgRevision.orgRevisionIsDraft == true && orgRevision.orgRevisionIsCurrent == false) { const profile = await this.profileRepo.findOne({
const profile = await this.profileRepo.findOne({ where: { keycloak: request.user.sub },
where: { keycloak: request.user.sub }, relations: ["permissionProfiles"],
relations: ["permissionProfiles"], });
}); if (!profile) {
if (!profile) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งานในทะเบียนประวัติ");
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งานในทะเบียนประวัติ");
}
_data = {
root: profile.permissionProfiles.map((x) => x.orgRootId),
child1: null,
child2: null,
child3: null,
child4: null,
};
} }
_data = {
root: profile.permissionProfiles.map((x) => x.orgRootId),
child1: null,
child2: null,
child3: null,
child4: null,
};
console.log(_data);
} }
const orgRootData = await AppDataSource.getRepository(OrgRoot) const orgRootData = await AppDataSource.getRepository(OrgRoot)