diff --git a/src/app/pages/activetask/activetask.page.ts b/src/app/pages/activetask/activetask.page.ts
index 97ad8b5..8d5ff31 100644
--- a/src/app/pages/activetask/activetask.page.ts
+++ b/src/app/pages/activetask/activetask.page.ts
@@ -1,5 +1,5 @@
import {Component, OnInit, ViewChild} from '@angular/core';
-import {NavController} from "@ionic/angular";
+import {AlertController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
import { BlogDataService } from 'src/app/store/blog-data.service';
@@ -21,6 +21,7 @@ export class ActivetaskPage implements OnInit {
private navctr: NavController,
private router: Router,
public sessionDataProviderService: SessionDataProviderService,
+ private alertController:AlertController,
private wrenchService: WrenchService,
public blogDataService: BlogDataService
) {
@@ -136,10 +137,51 @@ export class ActivetaskPage implements OnInit {
);
}
- taskCompleted(){
+ async taskCompleted(){
// alert(100);
+ let reqData = {
+ contract: this.jobData.contract,
+ contract_uid: this.jobData.contract_uid,
+ job_action: 'NOTIFY_COMPLETE',
+ }
+
+ const alert = await this.alertController.create({
+ header: "Confirm the task is completed.",
+ message: "The task owner will confirm the completion acceptance or rejection soon.",
+ buttons: [
+ {
+ text: "Cancel",
+ role: "cancel",
+ handler: () => {
+ // this.getMyOffersData();
+ },
+ },
+ {
+ text: "Confirm Completed ?",
+ handler: () => {
+// start
+ // API CALL TO MARK TASK AS COMPLETED BY WORKER
+ this.wrenchService.workerJobAction(reqData).subscribe((res)=> {
+ if (res.status != 200 || res.data.internal_return < 0) {
+ // setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
+ // Alert("Unable to set task as completed, try again soon");
+ } else {
+ this.router.navigate(['mytasks']);
+ }
+ }
+ );
+ // this.router.navigate(['mytasks']);
+ // end
+ },
+ },
+ ],
+ });
+ await alert.present();
}
taskCancel(){
}
+
+
+
}
diff --git a/src/app/pages/profile/profile.page.ts b/src/app/pages/profile/profile.page.ts
index 8425213..660a69b 100644
--- a/src/app/pages/profile/profile.page.ts
+++ b/src/app/pages/profile/profile.page.ts
@@ -1,6 +1,7 @@
import { Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
+import {AlertController} from "@ionic/angular";
@Component({
selector: 'app-profile',
@@ -16,6 +17,7 @@ export class ProfilePage implements OnInit {
constructor(
private router: Router,
+ private alertController:AlertController,
public sessionDataProviderService:SessionDataProviderService
) {
this.accountType = sessionDataProviderService.account_type;
@@ -61,9 +63,55 @@ export class ProfilePage implements OnInit {
onMyFiles() {
this.router.navigate(['myfiles']);
}
- onLogout() {
- this.sessionDataProviderService.DestroySessionOnLogout();
- this.router.navigate(['login']);
+ async onLogout() {
+ // this.sessionDataProviderService.DestroySessionOnLogout();
+ // this.router.navigate(['login']);
+ //this.requestLogout();
+
+ const alert = await this.alertController.create({
+ header: "Log out",
+ message: "Confirm you are ready to log out now.",
+ buttons: [
+ {
+ text: "Cancel",
+ role: "cancel",
+ handler: () => {
+ // this.getMyOffersData();
+ },
+ },
+ {
+ text: "Log out",
+ handler: () => {
+ this.sessionDataProviderService.DestroySessionOnLogout();
+ this.router.navigate(['login']);
+ },
+ },
+ ],
+ });
+ await alert.present();
}
+ async requestLogout() {
+ const alert = await this.alertController.create({
+ header: "Log out",
+ message: "Confirm you are ready to log out now.",
+ buttons: [
+ {
+ text: "Cancel",
+ role: "cancel",
+ handler: () => {
+ // this.getMyOffersData();
+ },
+ },
+ {
+ text: "Log out",
+ handler: () => {
+ this.sessionDataProviderService.DestroySessionOnLogout();
+ this.router.navigate(['login']);
+ },
+ },
+ ],
+ });
+ await alert.present();
+ }
}
diff --git a/src/app/pages/redeem/redeem.page.html b/src/app/pages/redeem/redeem.page.html
index 2b14d39..e1a9054 100644
--- a/src/app/pages/redeem/redeem.page.html
+++ b/src/app/pages/redeem/redeem.page.html
@@ -11,55 +11,42 @@