Fix sign up broken because of missing workspace schema (#6013)

Allow workspace datasource factory to return null if the workspace
schema has not been created yet
This commit is contained in:
Charles Bochet
2024-06-25 10:59:07 +02:00
committed by GitHub
parent 7fb5c9b60f
commit f8c057deea
3 changed files with 23 additions and 2 deletions

View File

@ -46,6 +46,15 @@ export class DataSourceService {
});
}
async getLastDataSourceMetadataFromWorkspaceId(
workspaceId: string,
): Promise<DataSourceEntity | null> {
return this.dataSourceMetadataRepository.findOne({
where: { workspaceId },
order: { createdAt: 'DESC' },
});
}
async getLastDataSourceMetadataFromWorkspaceIdOrFail(
workspaceId: string,
): Promise<DataSourceEntity> {