Fix ObjectType casing and conflict between Relation and RelationMetadata (#9849)
Fixes #9827 Also uncovered a conflict with `@objectType('Relation')` and `@objectType('relation)` I don't want to address it in this PR so I will create a followup issue when we close this but I think there's a confusion between Relation/RelationMetadata, it's unclear what is what --------- Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
This commit is contained in:
@ -17,9 +17,9 @@ import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/featu
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Entity({ name: 'featureFlag', schema: 'core' })
|
||||
@ObjectType('FeatureFlag')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
|
||||
export class FeatureFlagEntity {
|
||||
export class FeatureFlag {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ -4,16 +4,14 @@ import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
|
||||
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeORMModule,
|
||||
NestjsQueryGraphQLModule.forFeature({
|
||||
imports: [
|
||||
NestjsQueryTypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
],
|
||||
imports: [NestjsQueryTypeOrmModule.forFeature([FeatureFlag], 'core')],
|
||||
services: [],
|
||||
resolvers: [],
|
||||
}),
|
||||
|
||||
@ -6,13 +6,13 @@ import { Repository } from 'typeorm';
|
||||
import { FeatureFlagMap } from 'src/engine/core-modules/feature-flag/interfaces/feature-flag-map.interface';
|
||||
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
|
||||
@Injectable()
|
||||
export class FeatureFlagService {
|
||||
constructor(
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
public async isFeatureEnabled(
|
||||
@ -30,7 +30,7 @@ export class FeatureFlagService {
|
||||
|
||||
public async getWorkspaceFeatureFlags(
|
||||
workspaceId: string,
|
||||
): Promise<FeatureFlagEntity[]> {
|
||||
): Promise<FeatureFlag[]> {
|
||||
return this.featureFlagRepository.find({ where: { workspaceId } });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user