From 48dc2312d95e0f9afc3b1d69f0966fb8967e2c4e Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Sun, 15 Oct 2023 20:00:51 +0200 Subject: [PATCH] refactor: Remove redundant context variable from getConfig --- .../backend/src/graphql/queries/get-config.ee.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/backend/src/graphql/queries/get-config.ee.ts b/packages/backend/src/graphql/queries/get-config.ee.ts index 31e3eb13..844dfd6a 100644 --- a/packages/backend/src/graphql/queries/get-config.ee.ts +++ b/packages/backend/src/graphql/queries/get-config.ee.ts @@ -1,26 +1,20 @@ import { hasValidLicense } from '../../helpers/license.ee'; import Config from '../../models/config'; -import Context from '../../types/express/context'; type Params = { keys: string[]; }; -const getConfig = async ( - _parent: unknown, - params: Params, - context: Context -) => { - if (!await hasValidLicense()) return {}; +const getConfig = async (_parent: unknown, params: Params) => { + if (!(await hasValidLicense())) return {}; - const configQuery = Config - .query(); + const configQuery = Config.query(); if (Array.isArray(params.keys)) { configQuery.whereIn('key', params.keys); } - const config = await configQuery; + const config = await configQuery.orderBy('key', 'asc'); return config.reduce((computedConfig, configEntry) => { const { key, value } = configEntry;