Compute any new Workspace version from APP_VERSION (#10893)

# Introduction
We want any new activated workspace to be filled with a version equal to
the current `APP_VERSION`
Please note that in a workspace lifecycle this operation will be run
only once, discussed with @charlesBochet in front of `3 fois plus de
piments`

Going straightforward in this PR in order to release asap
Started et will continue to implem new integrations regarding `SignUp`
and `ActivateWorkspace` happy and expections path in
https://github.com/twentyhq/twenty/tree/prastoin-new-workspace-has-version-integrations-tests
This commit is contained in:
Paul Rastoin
2025-03-14 15:18:48 +01:00
committed by GitHub
parent c371dd5d27
commit 61f7625238

View File

@ -271,9 +271,12 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
});
await this.userWorkspaceService.createWorkspaceMember(workspace.id, user);
const appVersion = this.environmentService.get('APP_VERSION') ?? null;
await this.workspaceRepository.update(workspace.id, {
displayName: data.displayName,
activationStatus: WorkspaceActivationStatus.ACTIVE,
version: appVersion,
});
return await this.workspaceRepository.findOneBy({