feat: add create cashier component (#1064)

Fixes: #161
This commit is contained in:
Karan Takalkar
2020-07-12 14:23:33 +05:30
committed by GitHub
parent 3a78659d4b
commit b2afabc8d0
31 changed files with 316 additions and 59 deletions
@@ -25,7 +25,7 @@ export class CashierResolver implements Resolve<Object> {
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const cashierId = route.paramMap.get('id');
const tellerId = route.parent.paramMap.get('id');
const tellerId = route.parent.parent.paramMap.get('id');
return this.organizationService.getCashier(tellerId, cashierId);
}
@@ -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';
/**
* Cashier Template resolver.
*/
@Injectable()
export class EditCashierResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the cashier template.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const tellerId = route.parent.parent.paramMap.get('id');
return this.organizationService.getCashierTemplate(tellerId);
}
}