1
0
Fork 0
mirror of synced 2024-07-11 09:15:48 +12:00

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

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()
}
}