feat: create, view, edit, delete for hooks (#403)

- Add create-hook
- Add view-hook
- Add edit-hook

#180
This commit is contained in:
Chirag Gupta
2020-03-22 18:45:36 +05:30
committed by GitHub
parent 85b8e907f8
commit 17197056bb
24 changed files with 1264 additions and 13 deletions
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import {ActivatedRouteSnapshot, Resolve} from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { SystemService } from '../../system.service';
/**
* Hook data resolver.
*/
@Injectable()
export class HookResolver implements Resolve<Object> {
/**
* @param {SystemService} systemService System service.
*/
constructor(private systemService: SystemService) {}
/**
* Returns the manage hooks data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const hookId = route.paramMap.get('id');
return this.systemService.getHook(hookId);
}
}