Fix billing signup when workspace does not exist (#6018)

This commit is contained in:
Weiko 2024-06-25 15:51:01 +02:00 committed by GitHub
parent 7c2e745b45
commit 78865ee73e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,6 +102,11 @@ export class UserWorkspaceService extends TypeOrmQueryService<UserWorkspace> {
}
public async getWorkspaceMemberCount(): Promise<number | undefined> {
// TODO: to refactor, this could happen today for the first signup since the workspace does not exist yet
if (!this.workspaceMemberRepository) {
return undefined;
}
const workspaceMemberCount = await this.workspaceMemberRepository.count();
return workspaceMemberCount;