diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index 0a7430aa94..b794312fb6 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -57,17 +57,14 @@ async function getAndMergeDatasource(datasource: Datasource) { async function buildSchemaHelper(datasource: Datasource): Promise { const connector = (await getConnector(datasource)) as DatasourcePlus - return await connector.buildSchema( - datasource._id!, - datasource.entities! as Record - ) + return await connector.buildSchema(datasource._id!, datasource.entities!) } async function buildFilteredSchema( datasource: Datasource, filter?: string[] ): Promise { - let schema = await buildSchemaHelper(datasource) + const schema = await buildSchemaHelper(datasource) if (!filter) { return schema } diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index de3bf0e59e..2d61d05a01 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -362,8 +362,8 @@ class PostgresIntegration extends Sql implements DatasourcePlus { }) } - let finalizedTables = finaliseExternalTables(tables, entities) - let errors = checkExternalTables(finalizedTables) + const finalizedTables = finaliseExternalTables(tables, entities) + const errors = checkExternalTables(finalizedTables) return { tables: finalizedTables, errors } } catch (err) { // @ts-ignore