Fixing datasource error states causing a datasource to fail to be built fully - this was simply a frontend issue of the error not being handled on creation.

This commit is contained in:
mike12345567 2023-10-20 12:19:04 +01:00
parent 525898a93c
commit bc8e84b815
1 changed files with 3 additions and 3 deletions

View File

@ -81,9 +81,9 @@ export function createDatasourcesStore() {
})) }))
} }
const updateDatasource = response => { const updateDatasource = (response, { ignoreErrors } = {}) => {
const { datasource, errors } = response const { datasource, errors } = response
if (errors && Object.keys(errors).length > 0) { if (!ignoreErrors && errors && Object.keys(errors).length > 0) {
throw new TableImportError(errors) throw new TableImportError(errors)
} }
replaceDatasource(datasource._id, datasource) replaceDatasource(datasource._id, datasource)
@ -137,7 +137,7 @@ export function createDatasourcesStore() {
fetchSchema: integration.plus, fetchSchema: integration.plus,
}) })
return updateDatasource(response) return updateDatasource(response, { ignoreErrors: true })
} }
const update = async ({ integration, datasource }) => { const update = async ({ integration, datasource }) => {