From 2ba5fac9d4704ea7a5ce06525ec167515d15b2ac Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Fri, 21 Jun 2024 19:06:10 +0200 Subject: [PATCH] Update super-admin-dal.ts --- backend/src/services/super-admin/super-admin-dal.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/services/super-admin/super-admin-dal.ts b/backend/src/services/super-admin/super-admin-dal.ts index f95040aec9..04ec8b791e 100644 --- a/backend/src/services/super-admin/super-admin-dal.ts +++ b/backend/src/services/super-admin/super-admin-dal.ts @@ -19,9 +19,13 @@ export const superAdminDALFactory = (db: TDbClient) => { ) .first(); + if (!config) { + return null; + } + return { - defaultAuthOrgSlug: config?.defaultAuthOrgSlug || null, - ...config + ...config, + defaultAuthOrgSlug: config?.defaultAuthOrgSlug || null } as TSuperAdmin & { defaultAuthOrgSlug: string | null }; };