sort user groups

This commit is contained in:
Kyle Spearrin 2018-07-23 10:57:25 -04:00
parent 3544c96a64
commit 69e059ba01
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,8 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { OrganizationUserUpdateGroupsRequest } from 'jslib/models/request/organizationUserUpdateGroupsRequest'; import { OrganizationUserUpdateGroupsRequest } from 'jslib/models/request/organizationUserUpdateGroupsRequest';
import { GroupResponse } from 'jslib/models/response/groupResponse'; import { GroupResponse } from 'jslib/models/response/groupResponse';
import { Utils } from 'jslib/misc/utils';
@Component({ @Component({
selector: 'app-user-groups', selector: 'app-user-groups',
templateUrl: 'user-groups.component.html', templateUrl: 'user-groups.component.html',
@ -34,7 +36,9 @@ export class UserGroupsComponent implements OnInit {
async ngOnInit() { async ngOnInit() {
const groupsResponse = await this.apiService.getGroups(this.organizationId); const groupsResponse = await this.apiService.getGroups(this.organizationId);
this.groups = groupsResponse.data.map((r) => r); const groups = groupsResponse.data.map((r) => r);
groups.sort(Utils.getSortFunction(this.i18nService, 'name'));
this.groups = groups;
try { try {
const userGroups = await this.apiService.getOrganizationUserGroups( const userGroups = await this.apiService.getOrganizationUserGroups(