fix: now dividend is working (#1938)

This commit is contained in:
Pushpendra
2023-12-15 21:17:48 +05:30
committed by GitHub
parent 11098c60b1
commit 479d6af8b3
3 changed files with 3 additions and 3 deletions
@@ -24,7 +24,7 @@ export class DividendsResolver implements Resolve<Object> {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const id = route.paramMap.get('id'); const id = route.paramMap.get('productId');
return this.productsService.getDividends(id); return this.productsService.getDividends(id);
} }
@@ -25,7 +25,7 @@ export class ViewDividendDataResolver implements Resolve<Object> {
*/ */
resolve(route: ActivatedRouteSnapshot): Observable<any> { resolve(route: ActivatedRouteSnapshot): Observable<any> {
const dividendId = route.paramMap.get('dividendId'); const dividendId = route.paramMap.get('dividendId');
const shareProductId = route.parent.parent.paramMap.get('id'); const shareProductId = route.parent.parent.paramMap.get('productId');
return this.productsService.getDividendData(shareProductId, dividendId); return this.productsService.getDividendData(shareProductId, dividendId);
} }
@@ -40,7 +40,7 @@ export class ViewDividendComponent implements OnInit {
} }
postDividends() { postDividends() {
const shareProductId = this.route.parent.parent.snapshot.paramMap.get('id'); const shareProductId = this.route.parent.parent.snapshot.paramMap.get('productId');
const dividendId = this.route.snapshot.paramMap.get('dividendId'); const dividendId = this.route.snapshot.paramMap.get('dividendId');
this.productsService.approveDividend(shareProductId, dividendId, { productId: shareProductId, dividendId: dividendId}).subscribe(() => { this.productsService.approveDividend(shareProductId, dividendId, { productId: shareProductId, dividendId: dividendId}).subscribe(() => {
this.router.navigate(['../'], { relativeTo: this.route }); this.router.navigate(['../'], { relativeTo: this.route });