feat: add edit share account page (#881)

Fixes: #880
This commit is contained in:
Karan Takalkar
2020-06-17 15:15:39 +05:30
committed by GitHub
parent d51bd6466a
commit 21c54d0baa
16 changed files with 385 additions and 42 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 { SharesService } from '../shares.service';
/**
* Shares Account data and template resolver.
*/
@Injectable()
export class SharesAccountAndTemplateResolver implements Resolve<Object> {
/**
* @param {SharesService} SharesService Shares service.
*/
constructor(private sharesService: SharesService) { }
/**
* Returns the Shares Account data and template.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const shareAccountId = route.paramMap.get('shareAccountId');
return this.sharesService.getSharesAccountData(shareAccountId, true);
}
}
@@ -26,7 +26,7 @@ export class SharesAccountViewResolver implements Resolve<Object> {
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const shareAccountId = route.paramMap.get('shareAccountId');
return this.sharesService.getSharesAccountData(shareAccountId);
return this.sharesService.getSharesAccountData(shareAccountId, false);
}
}