Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
d38b7e6d90
1 changed files with 11 additions and 1 deletions
|
|
@ -589,12 +589,22 @@ export class OrganizationController extends Controller {
|
|||
*/
|
||||
@Get("{id}")
|
||||
async detail(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
let _data = {
|
||||
root: null,
|
||||
child1: null,
|
||||
child2: null,
|
||||
child3: null,
|
||||
child4: null,
|
||||
}
|
||||
|
||||
if (!request.user.role.includes('SUPER_ADMIN')) {
|
||||
_data = await new permission().PermissionOrgList(request, "SYS_ORG");
|
||||
}
|
||||
const orgRevision = await this.orgRevisionRepository.findOne({ where: { id } });
|
||||
if (!orgRevision) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
let _data = await new permission().PermissionOrgList(request, "SYS_ORG");
|
||||
const orgRootData = await AppDataSource.getRepository(OrgRoot)
|
||||
.createQueryBuilder("orgRoot")
|
||||
.where("orgRoot.orgRevisionId = :id", { id })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue