Treat suspended workspace as workspaces that need to be synced (#9669)
In this PR: - migrate WorkspaceActivationStatus to twenty-shared (and update case to make FE and BE consistent) - introduce isWorkspaceActiveOrSuspended in twenty-shared - refactor the code to use it (when we fetch data on the FE, we want to keep SUSPENDED workspace working + when we sync workspaces we want it too)
This commit is contained in:
@ -1,16 +1,13 @@
|
||||
import chalk from 'chalk';
|
||||
import { Option } from 'nest-commander';
|
||||
import { Repository } from 'typeorm';
|
||||
import { WorkspaceActivationStatus } from 'twenty-shared';
|
||||
import { In, Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
BaseCommandOptions,
|
||||
BaseCommandRunner,
|
||||
} from 'src/database/commands/base.command';
|
||||
import {
|
||||
Workspace,
|
||||
WorkspaceActivationStatus,
|
||||
} from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
export type ActiveWorkspacesCommandOptions = BaseCommandOptions & {
|
||||
workspaceId?: string;
|
||||
};
|
||||
@ -38,7 +35,10 @@ export abstract class ActiveWorkspacesCommandRunner extends BaseCommandRunner {
|
||||
const activeWorkspaces = await this.workspaceRepository.find({
|
||||
select: ['id'],
|
||||
where: {
|
||||
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
||||
activationStatus: In([
|
||||
WorkspaceActivationStatus.ACTIVE,
|
||||
WorkspaceActivationStatus.SUSPENDED,
|
||||
]),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user