1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Merge branch 'master' into fix/datadog-400-error

This commit is contained in:
Michael Drury 2024-07-31 11:20:23 +01:00 committed by GitHub
commit 29b803cddc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,51 +100,43 @@
async function handleFile(e) {
loading = true
error = null
const previousValidation = validation
validation = {}
try {
const response = await parseFile(e)
rows = response.rows
fileName = response.fileName
const newValidateHash = JSON.stringify(rows)
if (newValidateHash === validateHash) {
validation = previousValidation
} else {
await validate(rows)
validateHash = newValidateHash
}
} catch (e) {
error = e.message || e
} finally {
loading = false
error = e
}
}
async function validate(rows) {
loading = true
error = null
validation = {}
allValid = false
try {
if (rows.length > 0) {
const response = await API.validateExistingTableImport({
rows,
tableId,
})
if (rows.length > 0) {
const response = await API.validateExistingTableImport({
rows,
tableId,
})
validation = response.schemaValidation
invalidColumns = response.invalidColumns
allValid = response.allValid
}
} catch (e) {
error = e.message
validation = response.schemaValidation
invalidColumns = response.invalidColumns
allValid = response.allValid
}
loading = false
}
$: {
// binding in consumer is causing double renders here
const newValidateHash = JSON.stringify(rows)
if (newValidateHash !== validateHash) {
validate(rows)
}
validateHash = newValidateHash
}
</script>