diff --git a/resources/js/tasks/edit.js b/resources/js/tasks/edit.js index d803d81d34..fb85e7b8ef 100644 --- a/resources/js/tasks/edit.js +++ b/resources/js/tasks/edit.js @@ -240,6 +240,9 @@ const main = new Vue({ data, task_element_id: this.task.element_id, }) + .then(response => { + return this.eraseDraft(); + }) .then((response) => { this.fieldsToUpdate.splice(0); ProcessMaker.alert(this.$t("The request data was saved."), "success"); @@ -446,7 +449,7 @@ const main = new Vue({ }, eraseDraft() { this.formDataWatcherActive = false; - ProcessMaker.apiClient + return ProcessMaker.apiClient .delete(`drafts/${this.task.id}`) .then((response) => { this.resetRequestFiles(response);