[QRQC_2] No implicitAny in twenty-server (#12075)
# Introduction Following https://github.com/twentyhq/twenty/pull/12068 Related with https://github.com/twentyhq/core-team-issues/issues/975 We're enabling `noImplicitAny` handled few use case manually, added a `ts-expect-error` to the others, we should plan to handle them in the future
This commit is contained in:
+1
@@ -96,6 +96,7 @@ export class DistantTableService {
|
||||
await entityManager.query(`DROP SCHEMA "${tmpSchemaName}" CASCADE`);
|
||||
|
||||
return createdForeignTableNames.reduce(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(acc, { table_name, column_name, data_type, udt_name }) => {
|
||||
if (!acc[table_name]) {
|
||||
acc[table_name] = [];
|
||||
|
||||
+8
-4
@@ -41,11 +41,15 @@ export class ForeignTableService {
|
||||
await this.workspaceDataSourceService.connectToMainDataSource();
|
||||
|
||||
return (
|
||||
await mainDataSource.query(
|
||||
`SELECT foreign_table_name, foreign_server_name FROM information_schema.foreign_tables WHERE foreign_server_name = $1`,
|
||||
[foreignDataWrapperId],
|
||||
(
|
||||
await mainDataSource.query(
|
||||
`SELECT foreign_table_name, foreign_server_name FROM information_schema.foreign_tables WHERE foreign_server_name = $1`,
|
||||
[foreignDataWrapperId],
|
||||
)
|
||||
)
|
||||
).map((foreignTable) => foreignTable.foreign_table_name);
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
.map((foreignTable) => foreignTable.foreign_table_name)
|
||||
);
|
||||
}
|
||||
|
||||
public async createForeignTable(
|
||||
|
||||
+5
@@ -62,6 +62,7 @@ export class RemoteTableSchemaUpdateService {
|
||||
const tableName = remoteTable.distantTableName;
|
||||
|
||||
if (!distantTable) {
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
updates[tableName] = [DistantTableUpdate.TABLE_DELETED];
|
||||
continue;
|
||||
}
|
||||
@@ -78,13 +79,17 @@ export class RemoteTableSchemaUpdateService {
|
||||
);
|
||||
|
||||
if (columnsAdded.length > 0) {
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
updates[tableName] = [
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
...(updates[tableName] || []),
|
||||
DistantTableUpdate.COLUMNS_ADDED,
|
||||
];
|
||||
}
|
||||
if (columnsDeleted.length > 0) {
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
updates[tableName] = [
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
...(updates[tableName] || []),
|
||||
DistantTableUpdate.COLUMNS_DELETED,
|
||||
];
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ export const fetchTableColumns = async (
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
return res.map((column) => ({
|
||||
columnName: column.column_name,
|
||||
dataType: column.data_type,
|
||||
|
||||
Reference in New Issue
Block a user