if (event._outcome.name.toLowerCase() === "cancel") {
event.preventDefault();
this.cancelFormValues = new FormModel();
this.cancelFormValues = this.formOldValues;
this.formService
.completeTaskForm(this.currentTaskId, this.cancelFormValues, event._outcome.name)
.subscribe(
() => {
this.taskList.reload();
},
error => { alert(error); }
);
}
else {
event.preventDefault();
this.formService
.completeTaskForm(this.currentTaskId, event._outcome.form.values, event._outcome.name)
.subscribe(
data => {
this.taskList.reload();
},
error => {
let customErrors1 = JSON.parse(error);
let stringToSplit = customErrors1.exception;
if(stringToSplit == undefined){
this.snackBar.open(customErrors1.message, "ok", {
duration: 2500,
});
}
else {
let x = stringToSplit.split(":");
this.snackBar.open(x[2], "ok", {
duration: 2500,
});
}
}
);
}
}