Skip to content
Merged
Changes from all commits
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
18 changes: 10 additions & 8 deletions resources/js/components/templates/CreateTemplateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ export default {
formData.append("user_id", this.currentUserId);
formData.append("saveAssetsMode", this.saveAssetsMode);
formData.append("process_category_id", this.process_category_id);
this.customModalButtons[1].disabled = true;
ProcessMaker.apiClient.post("template/" + this.assetType + "/" + this.assetId, formData)
.then(response => {
ProcessMaker.alert(this.$t("Template successfully created"), "success");
this.close();
}).catch(error => {
this.errors = error.response.data;
this.customModalButtons[1].disabled = false;
if (this.errors.hasOwnProperty('errors')) {
this.errors = this.errors.errors;
} else if (_.includes(this.errors.name, 'The template name must be unique.')) {
Expand All @@ -180,14 +182,14 @@ export default {
},
updateTemplate() {
let putData = {
name: this.name,
description: this.description,
user_id: this.currentUserId,
mode: this.saveAssetsMode,
process_id: this.assetId,
process_category_id: this.process_category_id,
};
ProcessMaker.apiClient.put("template/" + this.assetType + "/" + this.existingAssetId, putData)
name: this.name,
description: this.description,
user_id: this.currentUserId,
mode: this.saveAssetsMode,
process_id: this.assetId,
process_category_id: this.process_category_id,
};
ProcessMaker.apiClient.put("template/" + this.assetType + "/" + this.existingAssetId, putData)
.then(response => {
ProcessMaker.alert( this.$t("Template successfully updated"),"success");
this.close();
Expand Down