diff --git a/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts b/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts index d5c4732e1c..69c0180686 100644 --- a/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts +++ b/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts @@ -164,10 +164,7 @@ export class BillingWebhookSubscriptionService { } else if ( workspace.activationStatus === WorkspaceActivationStatus.SUSPENDED ) { - await this.workspaceRepository.update(workspaceId, { - activationStatus: WorkspaceActivationStatus.ACTIVE, - suspendedAt: null, - }); + await this.workspaceService.reactivateWorkspace(workspaceId); await this.messageQueueService.add( CleanWorkspaceDeletionWarningUserVarsJob.name, diff --git a/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts b/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts index 9b930d8173..6c1d3f50c4 100644 --- a/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts +++ b/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts @@ -484,6 +484,17 @@ export class WorkspaceService extends TypeOrmQueryService { activationStatus: WorkspaceActivationStatus.SUSPENDED, suspendedAt: new Date(), }); + + await this.coreEntityCacheService.invalidate('workspaceEntity', id); + } + + async reactivateWorkspace(id: string) { + await this.workspaceRepository.update(id, { + activationStatus: WorkspaceActivationStatus.ACTIVE, + suspendedAt: null, + }); + + await this.coreEntityCacheService.invalidate('workspaceEntity', id); } async deleteWorkspace(id: string, softDelete = false) {