From 99d369fc796079d4eaa55d55f6d0d41fd4ac0d26 Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Mon, 11 Dec 2023 18:31:34 +0600 Subject: [PATCH] chore: renamed an enum --- packages/hoppscotch-backend/src/infra-config/helper.ts | 2 +- .../src/infra-config/infra-config.model.ts | 6 +++--- .../src/infra-config/infra-config.service.ts | 6 +++--- packages/hoppscotch-backend/src/infra-config/input-args.ts | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/hoppscotch-backend/src/infra-config/helper.ts b/packages/hoppscotch-backend/src/infra-config/helper.ts index f01bae6ba..f9c4d66ef 100644 --- a/packages/hoppscotch-backend/src/infra-config/helper.ts +++ b/packages/hoppscotch-backend/src/infra-config/helper.ts @@ -1,6 +1,6 @@ import { PrismaService } from 'src/prisma/prisma.service'; -export enum AuthProviderStatus { +export enum ServiceStatus { ENABLE = 'ENABLE', DISABLE = 'DISABLE', } diff --git a/packages/hoppscotch-backend/src/infra-config/infra-config.model.ts b/packages/hoppscotch-backend/src/infra-config/infra-config.model.ts index fec9bb861..6335261ca 100644 --- a/packages/hoppscotch-backend/src/infra-config/infra-config.model.ts +++ b/packages/hoppscotch-backend/src/infra-config/infra-config.model.ts @@ -1,7 +1,7 @@ import { Field, ObjectType, registerEnumType } from '@nestjs/graphql'; import { AuthProvider } from 'src/auth/helper'; import { InfraConfigEnumForClient } from 'src/types/InfraConfig'; -import { AuthProviderStatus } from './helper'; +import { ServiceStatus } from './helper'; @ObjectType() export class InfraConfig { @@ -24,6 +24,6 @@ registerEnumType(AuthProvider, { name: 'AuthProvider', }); -registerEnumType(AuthProviderStatus, { - name: 'AuthProviderStatus', +registerEnumType(ServiceStatus, { + name: 'ServiceStatus', }); diff --git a/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts b/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts index d2402ae64..5f8f34868 100644 --- a/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts +++ b/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts @@ -18,7 +18,7 @@ import { } from 'src/errors'; import { throwErr, validateEmail, validateSMTPUrl } from 'src/utils'; import { ConfigService } from '@nestjs/config'; -import { AuthProviderStatus, stopApp } from './helper'; +import { ServiceStatus, stopApp } from './helper'; import { EnableAndDisableSSOArgs, InfraConfigArgs } from './input-args'; @Injectable() @@ -196,9 +196,9 @@ export class InfraConfigService implements OnModuleInit { let updatedAuthProviders = allowedAuthProviders; providerInfo.forEach(({ provider, status }) => { - if (status === AuthProviderStatus.ENABLE) { + if (status === ServiceStatus.ENABLE) { updatedAuthProviders.push(provider); - } else if (status === AuthProviderStatus.DISABLE) { + } else if (status === ServiceStatus.DISABLE) { updatedAuthProviders = updatedAuthProviders.filter( (p) => p !== provider, ); diff --git a/packages/hoppscotch-backend/src/infra-config/input-args.ts b/packages/hoppscotch-backend/src/infra-config/input-args.ts index 74c80ac59..6b4c26850 100644 --- a/packages/hoppscotch-backend/src/infra-config/input-args.ts +++ b/packages/hoppscotch-backend/src/infra-config/input-args.ts @@ -1,6 +1,6 @@ import { Field, InputType } from '@nestjs/graphql'; import { InfraConfigEnumForClient } from 'src/types/InfraConfig'; -import { AuthProviderStatus } from './helper'; +import { ServiceStatus } from './helper'; import { AuthProvider } from 'src/auth/helper'; @InputType() @@ -23,8 +23,8 @@ export class EnableAndDisableSSOArgs { }) provider: AuthProvider; - @Field(() => AuthProviderStatus, { + @Field(() => ServiceStatus, { description: 'Auth Provider Status', }) - status: AuthProviderStatus; + status: ServiceStatus; }