fix no billing subscription error (#11257)

closes https://github.com/twentyhq/core-team-issues/issues/625

Context : 
Soft-deleted workspaces no longer have any subscriptions. Computing
inactivity causes an error.
This commit is contained in:
Etienne
2025-03-28 15:45:13 +01:00
committed by GitHub
parent 3e5a6d0a5e
commit da9e078283
2 changed files with 29 additions and 23 deletions

View File

@ -319,11 +319,13 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
softDelete,
);
}
this.logger.log(`workspace ${id} user workspaces deleted`);
await this.workspaceCacheStorageService.flush(
workspace.id,
workspace.metadataVersion,
);
this.logger.log(`workspace ${id} cache flushed`);
if (softDelete) {
if (this.billingService.isBillingEnabled()) {
@ -348,6 +350,7 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
await this.customDomainService.deleteCustomHostnameByHostnameSilently(
workspace.customDomain,
);
this.logger.log(`workspace ${id} custom domain deleted`);
}
await this.workspaceRepository.delete(id);