Account for table 'type' field meaning different things in different endpoints

This commit is contained in:
Andrew Kingston 2023-06-15 09:35:22 +01:00
parent 3cbebaf40d
commit 9e535a1ca4
1 changed files with 5 additions and 2 deletions

View File

@ -30,8 +30,11 @@
const handleGridTableUpdate = async e => {
tables.replaceTable(id, e.detail)
// We need to refresh datasources when an external table changes
if (e.detail?.type === "external") {
// We need to refresh datasources when an external table changes.
// Type "external" may exist - sometimes type is "table" and sometimes it
// is "external" - it has different meanings in different endpoints.
// If we check both these then we hopefully catch all external tables.
if (e.detail?.type === "external" || e.detail?.sql) {
await datasources.fetch()
}
}