feat: add edit center action (#1222)

Fixes: #1221
This commit is contained in:
Muskan Khedia
2020-08-23 21:50:55 +05:30
committed by GitHub
parent a783f92ce1
commit e4791d5761
10 changed files with 438 additions and 182 deletions
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { CentersService } from '../centers.service';
/**
* Centers data and template resolver.
*/
@Injectable()
export class CenterDataAndTemplateResolver implements Resolve<Object> {
/**
* @param {CentersService} CentersService Centers service.
*/
constructor(private centersService: CentersService) { }
/**
* Returns the Centers and template data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const centerId = route.parent.paramMap.get('centerId');
return this.centersService.getCenterAndTemplateData(centerId);
}
}