|
|
@ -18,6 +18,7 @@ |
|
|
let schema = {} |
|
|
let schema = {} |
|
|
let fields = [] |
|
|
let fields = [] |
|
|
|
|
|
|
|
|
|
|
|
$: console.log(files[0]) |
|
|
$: valid = !schema || fields.every(column => schema[column].success) |
|
|
$: valid = !schema || fields.every(column => schema[column].success) |
|
|
$: dataImport = { |
|
|
$: dataImport = { |
|
|
valid, |
|
|
valid, |
|
|
@ -43,6 +44,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function validateCSV() { |
|
|
async function validateCSV() { |
|
|
|
|
|
console.log(csvString) |
|
|
const response = await api.post("/api/tables/csv/validate", { |
|
|
const response = await api.post("/api/tables/csv/validate", { |
|
|
csvString, |
|
|
csvString, |
|
|
schema: schema || {}, |
|
|
schema: schema || {}, |
|
|
@ -82,7 +84,7 @@ |
|
|
files = fileArray |
|
|
files = fileArray |
|
|
validateCSV() |
|
|
validateCSV() |
|
|
}) |
|
|
}) |
|
|
reader.readAsBinaryString(fileArray[0]) |
|
|
reader.readAsText(fileArray[0]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function omitColumn(columnName) { |
|
|
async function omitColumn(columnName) { |
|
|
|