diff --git a/src/app/pages/activetask/activetask.page.ts b/src/app/pages/activetask/activetask.page.ts index 8d5ff31..65df9a0 100644 --- a/src/app/pages/activetask/activetask.page.ts +++ b/src/app/pages/activetask/activetask.page.ts @@ -178,8 +178,45 @@ export class ActivetaskPage implements OnInit { }); await alert.present(); } - taskCancel(){ + async taskCancel(){ + let reqData = { + contract: this.jobData.contract, + contract_uid: this.jobData.contract_uid, + job_action: 'NOTIFY_CANCEL', + } + const alert = await this.alertController.create({ + header: "Confirm Cancel Request.", + message: "The task owner will be informed of this cancellation. Once completed, we cannot reverse this action.", + buttons: [ + { + text: "Cancel", + role: "cancel", + handler: () => { + // this.getMyOffersData(); + }, + }, + { + text: "Confirm Cancel ?", + 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(); } diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html index 98cfdba..73c365b 100644 --- a/src/app/pages/profile/profile.page.html +++ b/src/app/pages/profile/profile.page.html @@ -109,11 +109,11 @@