add bank pages

This commit is contained in:
CHIEFSOFT\ameye
2023-11-15 14:47:55 -05:00
parent 4580af7b5e
commit 58ad6fca16
3 changed files with 30 additions and 38 deletions
+12 -5
View File
@@ -1,5 +1,5 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {AlertController, NavController, ToastController} from "@ionic/angular";
import {AlertController, NavController, ToastController, LoadingController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
@@ -30,7 +30,8 @@ export class AddbankPage implements OnInit {
private wrenchService: WrenchService,
private alertController: AlertController,
private toastController: ToastController,
public recipientsService: RecipientsService
public recipientsService: RecipientsService,
private loadingCtrl: LoadingController
)
{
this.walletData = this.router.getCurrentNavigation().extras.state;
@@ -128,8 +129,13 @@ export class AddbankPage implements OnInit {
city: string,
};
accountAddResult :any;
addRecipientAccount(){
accountAddResult :any;
async addRecipientAccount(){
const loading = await this.loadingCtrl.create({
message: 'Adding recipent account',
duration: 5000,
});
this.reqData = {
action:11176,
@@ -145,13 +151,14 @@ export class AddbankPage implements OnInit {
state: this.account_state,
city: this.account_city,
};
loading.present();
this.wrenchService.addRecipientAccount(this.reqData).subscribe(
accountAddResult => {
this.accountAddResult = accountAddResult;
console.log("accountAddResult RETURN->", this.accountAddResult);
if ( this.accountAddResult.internal_return != undefined && this.accountAddResult.internal_return > 0 ){
this.presentToast("Recipient Accound Added",'middle');
loading.dismiss();
setTimeout(() => {
this.recipientsService.getMyRecipientsData();
this.onBack();