Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ensure Process Template Import Status Before Retry
  • Loading branch information
sanjacornelius committed Feb 27, 2024
commit 30d019df56ad8406d22d79e2ebab03d92587169a
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default {
task: null,
currentUserId: null,
formData: {},
importingProcess: false,
};
},
methods: {
Expand Down Expand Up @@ -86,9 +87,9 @@ export default {
this.task = task;
},
completed() {
if (this.shouldImportProcessTemplate) {
if (!this.importingProcess && this.shouldImportProcessTemplate) {
this.importProcessTemplate();
} else {
} else if (!this.shouldImportProcessTemplate) {
this.showHelperProcess = false;
this.$bvModal.hide("processWizard");
}
Expand All @@ -103,15 +104,17 @@ export default {
});
},
importProcessTemplate() {
this.importingProcess = true;
ProcessMaker.apiClient.post(`template/create/process/${this.template.process_template_id}`, {
name: this.template.name,
description: this.template.description,
version: "1.0.0", // TODO: Wizards should have a versions property
version: "1.0.0",
process_category_id: this.template.process.process_category_id,
projects: null,
wizardTemplateUuid: this.template.uuid,
helperProcessRequestId: this.task.process_request_id,
}).then((response) => {
this.importingProcess = false;
if (response.data?.existingAssets) {
this.handleExistingAssets(response.data);
} else {
Expand Down