mirror of
https://github.com/bitwarden/web
synced 2025-12-21 02:33:19 +00:00
collection and group listing from org admin
This commit is contained in:
@@ -1,7 +1,39 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { ApiService } from 'jslib/abstractions/api.service';
|
||||
|
||||
import { GroupResponse } from 'jslib/models/response/groupUserResponse';
|
||||
|
||||
@Component({
|
||||
selector: 'app-org-groups',
|
||||
templateUrl: 'groups.component.html',
|
||||
})
|
||||
export class GroupsComponent { }
|
||||
export class GroupsComponent implements OnInit {
|
||||
loading = true;
|
||||
organizationId: string;
|
||||
groups: GroupResponse[];
|
||||
searchText: string;
|
||||
|
||||
constructor(private apiService: ApiService, private route: ActivatedRoute) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.parent.parent.params.subscribe(async (params) => {
|
||||
this.organizationId = params.organizationId;
|
||||
});
|
||||
await this.load();
|
||||
}
|
||||
|
||||
async load() {
|
||||
const response = await this.apiService.getGroups(this.organizationId);
|
||||
if (response.data != null && response.data.length > 0) {
|
||||
this.groups = response.data;
|
||||
} else {
|
||||
this.groups = [];
|
||||
}
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user