Enable new record board and messaging for all workspaces except demo (#4243)

* Enable new record board and messaging for all workspaces except demo

* Fix according to PR
This commit is contained in:
Charles Bochet
2024-02-29 18:22:32 +01:00
committed by GitHub
parent 773f698faf
commit fb439e3045
16 changed files with 72 additions and 233 deletions
@@ -1,13 +1,7 @@
import { InjectRepository } from '@nestjs/typeorm';
import { Inject } from '@nestjs/common';
import { Command, CommandRunner, Option } from 'nest-commander';
import { Repository } from 'typeorm';
import {
FeatureFlagEntity,
FeatureFlagKeys,
} from 'src/core/feature-flag/feature-flag.entity';
import { MessageQueue } from 'src/integrations/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/integrations/message-queue/services/message-queue.service';
import {
@@ -26,8 +20,6 @@ interface GmailPartialSyncOptions {
})
export class GmailPartialSyncCommand extends CommandRunner {
constructor(
@InjectRepository(FeatureFlagEntity, 'core')
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
@Inject(MessageQueue.messagingQueue)
private readonly messageQueueService: MessageQueueService,
private readonly connectedAccountService: ConnectedAccountService,
@@ -39,16 +31,6 @@ export class GmailPartialSyncCommand extends CommandRunner {
_passedParam: string[],
options: GmailPartialSyncOptions,
): Promise<void> {
const isMessagingEnabled = await this.featureFlagRepository.findOneBy({
workspaceId: options.workspaceId,
key: FeatureFlagKeys.IsMessagingEnabled,
value: true,
});
if (!isMessagingEnabled) {
throw new Error('Messaging is not enabled for this workspace');
}
await this.fetchWorkspaceMessages(options.workspaceId);
return;