From b0b7df0a3ef662656ef144296fa4305a07e73b42 Mon Sep 17 00:00:00 2001 From: mirarifhasan Date: Thu, 8 Feb 2024 15:30:05 +0600 Subject: [PATCH] feat: removed unnecessary checks --- .../src/infra-config/infra-config.service.ts | 8 -------- 1 file changed, 8 deletions(-) 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 a9c8042e0..e3e379c8a 100644 --- a/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts +++ b/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts @@ -51,17 +51,9 @@ export class InfraConfigService implements OnModuleInit { */ async initializeInfraConfigTable() { try { - // Get all the 'names' of the properties from ENUM to be saved in the 'infra_config' table - const enumValues = Object.values(InfraConfigEnum); - // Fetch the default values (value in .env) for configs to be saved in 'infra_config' table const infraConfigDefaultObjs = await getDefaultInfraConfigs(); - // Cross-check if all the 'names' are listed in the default-values-list and ENUM at the same time - if (enumValues.length !== infraConfigDefaultObjs.length) { - throw new Error(INFRA_CONFIG_NOT_LISTED); - } - // Eliminate the rows (from 'infraConfigDefaultObjs') that are already present in the database table const dbInfraConfigs = await this.prisma.infraConfig.findMany(); const propsToInsert = infraConfigDefaultObjs.filter(