diff --git a/test-track/frontend/src/api/issue.js b/test-track/frontend/src/api/issue.js index ecc879e22a..6ba07b92dc 100644 --- a/test-track/frontend/src/api/issue.js +++ b/test-track/frontend/src/api/issue.js @@ -263,7 +263,7 @@ export function getPluginCustomFields(projectId) { return get(BASE_URL + `plugin/custom/fields/${projectId}`); } -export function getIssuePartTemplateWithProject(callback) { +export function getIssuePartTemplateWithProject(callback, reject) { getCurrentProject().then((response) => { let currentProject = response.data; enableThirdPartTemplate(currentProject.id) @@ -273,6 +273,10 @@ export function getIssuePartTemplateWithProject(callback) { .then((template) => { if (callback) callback(template, currentProject); + }).catch((r) => { + if (reject) { + reject(r); + } }); } else { Promise.all([getPluginCustomFields(currentProject.id), getIssueTemplate()]) diff --git a/test-track/frontend/src/business/issue/IssueEditDetail.vue b/test-track/frontend/src/business/issue/IssueEditDetail.vue index 62d0d0fe24..3cc12a9e1d 100644 --- a/test-track/frontend/src/business/issue/IssueEditDetail.vue +++ b/test-track/frontend/src/business/issue/IssueEditDetail.vue @@ -393,6 +393,8 @@ export default { .then(r => { this.enableThirdPartTemplate = r.data; }); + }, () => { + this.result.loading = false; }); }); }, diff --git a/test-track/frontend/src/business/issue/IssueList.vue b/test-track/frontend/src/business/issue/IssueList.vue index 9bfdf5b7e4..23fdf1384b 100644 --- a/test-track/frontend/src/business/issue/IssueList.vue +++ b/test-track/frontend/src/business/issue/IssueList.vue @@ -301,6 +301,8 @@ export default { }); getIssuePartTemplateWithProject((template) => { this.initFields(template); + }, () => { + this.loading = false; }); }); this.getIssues(); @@ -558,10 +560,13 @@ export default { checkSyncIssues(this.loading); } else { this.$success(this.$t('test_track.issue.sync_complete')); - this.loading = false; + this.getIssues(); } - }); + }) + .catch(() => { + this.loading = false; + }); }, syncIssues() { this.loading = true; @@ -574,6 +579,8 @@ export default { this.loading = false; this.getIssues(); } + }).catch(() => { + this.loading = false; }); }, editParam() {