diff --git a/src/module/alertModal.js b/src/module/alertModal.js index acf7f7d..0e7ae9c 100644 --- a/src/module/alertModal.js +++ b/src/module/alertModal.js @@ -172,8 +172,8 @@ export async function leaveConformance(next, addConformanceCreateCheckId, toPath * @param { string } failureMsg */ export async function uploadFailedFirst(failureType, failureMsg, failureLoc) { - // msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv' - // type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix' + // msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv' | 'not a CSV file' + // type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix' | mime_type let value = ''; switch (failureType) { case 'size': @@ -189,7 +189,8 @@ export async function uploadFailedFirst(failureType, failureMsg, failureLoc) { value = 'Need at least one record of data.'; break; case 'name_suffix': - value = 'File is not in [csv] format.'; + case 'mime_type': + value = 'File is not in csv format.'; break; default: value = failureMsg; diff --git a/src/stores/files.js b/src/stores/files.js index 1be5c23..7533009 100644 --- a/src/stores/files.js +++ b/src/stores/files.js @@ -128,6 +128,7 @@ export default defineStore('filesStore', { this.$router.push({name: 'Upload'}); Swal.close(); // 關閉進度條 } catch(error) { + console.log(error); if(error.response.status === 422) { // msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv' // type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'