feat: add view holiday component (#780)

Fixes: #749
This commit is contained in:
Benura Abeywardena
2020-05-22 19:35:22 +05:30
committed by GitHub
parent 5e1b1aeae5
commit 0bd07753a9
9 changed files with 238 additions and 6 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 { OrganizationService } from 'app/organization/organization.service';
/**
* Holiday data resolver.
*/
@Injectable()
export class HolidayResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the holiday data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const holidayId = route.paramMap.get('id');
return this.organizationService.getHoliday(holidayId);
}
}