diff --git a/src/app/pages/suggestdetails/suggestdetails.page.html b/src/app/pages/suggestdetails/suggestdetails.page.html index bba49ec..8091652 100644 --- a/src/app/pages/suggestdetails/suggestdetails.page.html +++ b/src/app/pages/suggestdetails/suggestdetails.page.html @@ -60,15 +60,6 @@
- - - Send Reminder - - Cancel Request + + + Send Reminder + + + +
diff --git a/src/app/pages/suggestdetails/suggestdetails.page.ts b/src/app/pages/suggestdetails/suggestdetails.page.ts index cb47414..964f704 100644 --- a/src/app/pages/suggestdetails/suggestdetails.page.ts +++ b/src/app/pages/suggestdetails/suggestdetails.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import {AlertController, NavController} from "@ionic/angular"; +import {AlertController, LoadingController, NavController} from "@ionic/angular"; import {Router} from "@angular/router"; import {SessionDataProviderService} from "../../store/session-data-provider.service"; import {WrenchService} from "../../services/wrench.service"; @@ -12,16 +12,17 @@ import {WrenchService} from "../../services/wrench.service"; export class SuggestdetailsPage implements OnInit { - tabs = 'about'; -suggestTotalData:any; + tabs = 'about'; + suggestTotalData:any; suggestData:any; -suggestActionData:any; + suggestActionData:any; constructor( private navctr: NavController, private router: Router, public sessionDataProviderService: SessionDataProviderService, private alertController:AlertController, - private wrenchService: WrenchService + private wrenchService: WrenchService, + private loadingCtrl: LoadingController, ) { // debugger; this.suggestTotalData = this.router.getCurrentNavigation().extras.state; @@ -66,7 +67,7 @@ suggestActionData:any; text: "Send", handler: () => { this.setSuggestStatus(222); // remind - this.onBack(); + // this.onBack(); }, }, ], @@ -99,13 +100,18 @@ suggestActionData:any; await alert.present(); } statusResult:any; + sendDisabled:boolean= false; //define('WRENCHBOARD_FAMILY_SGGESTSTATUS', 22026); suggestEditData: { action:number, member_id: number, uid: string, sessionid: string, suggest_uid:20, suggest_action: string,offset: 0 }; - setSuggestStatus(suggest_action){ + async setSuggestStatus(suggest_action){ + const loading = await this.loadingCtrl.create({ + message: 'Sending...', + duration: 3500, + }); this.suggestEditData = { action:22026, @@ -116,10 +122,14 @@ suggestActionData:any; suggest_action:suggest_action,offset: 0 }; + loading.present(); + this.wrenchService.setSuggestStatus(this.suggestEditData).subscribe( statusResult => { - this.statusResult = statusResult; - console.log("statusResult RETURN->", this.statusResult); + loading.dismiss(); + this.statusResult = statusResult; + console.log("statusResult RETURN->", this.statusResult); + this.sendDisabled= true; //this.total_family = this.familyData.length; }