Delete message when no more association (#3701)

* Delete message when no more association

* remove unused injections

* rename methods

* fix after review
This commit is contained in:
Weiko
2024-01-30 17:58:36 +01:00
committed by GitHub
parent 8b9d62e425
commit 64b2ef3dc2
23 changed files with 501 additions and 201 deletions

View File

@ -22,6 +22,15 @@ export class WorkspaceDataSourceService {
public async connectToWorkspaceDataSource(
workspaceId: string,
): Promise<DataSource> {
const { dataSource } =
await this.connectedToWorkspaceDataSourceAndReturnMetadata(workspaceId);
return dataSource;
}
public async connectedToWorkspaceDataSourceAndReturnMetadata(
workspaceId: string,
) {
const dataSourceMetadata =
await this.dataSourceService.getLastDataSourceMetadataFromWorkspaceIdOrFail(
workspaceId,
@ -36,7 +45,7 @@ export class WorkspaceDataSourceService {
);
}
return dataSource;
return { dataSource, dataSourceMetadata };
}
/**