feat: groups add and unassign role (#1027)

Fixes #1026
This commit is contained in:
Karan Takalkar
2020-07-08 14:19:51 +05:30
committed by GitHub
parent 5e9e71f66f
commit 356cda70b8
14 changed files with 454 additions and 140 deletions
@@ -0,0 +1,32 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { GroupsService } from '../groups.service';
/**
* Groups data and template resolver.
*/
@Injectable()
export class GroupDataAndTemplateResolver implements Resolve<Object> {
/**
* @param {GroupsService} GroupsService Groups service.
*/
constructor(private groupsService: GroupsService) { }
/**
* Returns the Groups data and template.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const groupId = route.paramMap.get('groupId');
return this.groupsService.getGroupData(groupId, 'true');
}
}