Fixing an issue with getAllExternalTables getter also returning internal tables.
This commit is contained in:
parent
c055e2ae72
commit
0698454855
|
@ -82,8 +82,11 @@ export async function getAllInternalTables(db?: Database): Promise<Table[]> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getAllExternalTables(): 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 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[] = []
|
let final: Table[] = []
|
||||||
for (let entities of allEntities) {
|
for (let entities of allEntities) {
|
||||||
if (entities) {
|
if (entities) {
|
||||||
|
|
Loading…
Reference in New Issue