This commit is contained in:
@@ -74,6 +74,7 @@ export default {
|
||||
if (!this.uploadFile) {
|
||||
return;
|
||||
}
|
||||
this.importResult = "";
|
||||
try {
|
||||
let fileType = this.uploadFile.type.toLowerCase();
|
||||
if (!fileType.includes("csv") && !fileType.includes("json")) {
|
||||
@@ -82,7 +83,13 @@ export default {
|
||||
const isCSV = fileType.includes("csv");
|
||||
let dat = null;
|
||||
if (isCSV) {
|
||||
dat = await parseCSVFile(this.uploadFile);
|
||||
let res = await parseCSVFile(this.uploadFile);
|
||||
if (res.errors) {
|
||||
this.importResult = JSON.stringify(res.errors);
|
||||
}
|
||||
if (res.data) {
|
||||
dat = res.data;
|
||||
}
|
||||
console.log("Done parseCSVFile");
|
||||
} else {
|
||||
dat = await parseJSONFile(this.uploadFile);
|
||||
|
||||
Reference in New Issue
Block a user