fix: Issues #234 done.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user