2018-06-08 23:08:19 +02:00
|
|
|
import {
|
|
|
|
Component,
|
2018-07-03 21:11:58 +02:00
|
|
|
OnInit,
|
2018-06-08 23:08:19 +02:00
|
|
|
} from '@angular/core';
|
2018-07-03 21:11:58 +02:00
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
|
|
|
|
import { UserService } from 'jslib/abstractions/user.service';
|
|
|
|
|
|
|
|
import { Organization } from 'jslib/models/domain/organization';
|
2018-06-08 23:08:19 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-organization-layout',
|
|
|
|
templateUrl: 'organization-layout.component.html',
|
|
|
|
})
|
2018-07-03 21:11:58 +02:00
|
|
|
export class OrganizationLayoutComponent implements OnInit {
|
|
|
|
organization: Organization;
|
|
|
|
|
|
|
|
private organizationId: string;
|
|
|
|
|
|
|
|
constructor(private route: ActivatedRoute, private userService: UserService) { }
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.route.params.subscribe(async (params) => {
|
|
|
|
this.organizationId = params.organizationId;
|
|
|
|
await this.load();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async load() {
|
|
|
|
this.organization = await this.userService.getOrganization(this.organizationId);
|
|
|
|
}
|
|
|
|
}
|