feat: shares account actions (approve-shares) (#908)

Fixes: #907
This commit is contained in:
Karan Takalkar
2020-06-25 00:03:12 +05:30
committed by GitHub
parent a9cd990184
commit 245c6c3df3
15 changed files with 274 additions and 17 deletions
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { DatePipe } from '@angular/common';
import { ActivatedRoute, Router } from '@angular/router';
@@ -17,6 +17,9 @@ import { SharesService } from 'app/shares/shares.service';
})
export class RedeemSharesComponent implements OnInit {
/** Shares account data. */
@Input() sharesAccountData: any;
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum date allowed. */
@@ -48,9 +51,7 @@ export class RedeemSharesComponent implements OnInit {
*/
ngOnInit() {
this.createRedeemSharesAccountForm();
this.sharesService.getSharesAccountData(this.accountId, false).subscribe((response: any) => {
this.redeemSharesForm.get('unitPrice').patchValue(response.currentMarketPrice || '');
});
this.redeemSharesForm.get('unitPrice').patchValue(this.sharesAccountData.currentMarketPrice || '');
}
/**