cancel task
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user