From c194fe202ff7ca1d958654c8536e751bcda2ed3e Mon Sep 17 00:00:00 2001 From: Hironsan Date: Wed, 13 Nov 2019 21:46:34 +0900 Subject: [PATCH] Enable to show document upload error message --- .../documents/DocumentUploadForm.vue | 21 ++++++++++++++++--- frontend/store/documents.js | 5 +---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/frontend/components/organisms/documents/DocumentUploadForm.vue b/frontend/components/organisms/documents/DocumentUploadForm.vue index 95da2b2e..bc70eab5 100644 --- a/frontend/components/organisms/documents/DocumentUploadForm.vue +++ b/frontend/components/organisms/documents/DocumentUploadForm.vue @@ -12,6 +12,15 @@ ref="form" v-model="valid" > + + The file could not be uploaded. Maybe invalid format. + Please check available formats carefully. +

Select a file format

{ + this.reset() + this.cancel() + }) + .catch(() => { + this.showError = true + }) } } } diff --git a/frontend/store/documents.js b/frontend/store/documents.js index aa8bfd35..20fbaad8 100644 --- a/frontend/store/documents.js +++ b/frontend/store/documents.js @@ -111,13 +111,10 @@ export const actions = { 'Content-Type': 'multipart/form-data' } } - DocumentService.uploadFile(data.projectId, formData, config) + return DocumentService.uploadFile(data.projectId, formData, config) .then((response) => { dispatch('getDocumentList', data) }) - .catch((error) => { - alert(error) - }) .finally(() => { commit('setLoading', false) })