Fixing an issue with getAllExternalTables getter also returning internal tables.

This commit is contained in:
mike12345567 2024-10-28 18:09:22 +00:00
parent c055e2ae72
commit 0698454855
1 changed files with 4 additions and 1 deletions

View File

@ -82,8 +82,11 @@ export async function getAllInternalTables(db?: Database): Promise<Table[]> {
}
async function getAllExternalTables(): Promise<Table[]> {
// this is all datasources, we'll need to filter out internal
const datasources = await sdk.datasources.fetch({ enriched: true })
const allEntities = datasources.map(datasource => datasource.entities)
const allEntities = datasources
.filter(datasource => datasource._id !== INTERNAL_TABLE_SOURCE_ID)
.map(datasource => datasource.entities)
let final: Table[] = []
for (let entities of allEntities) {
if (entities) {