From ba2b7ef43ceb18198a6a865fc9939c9353cd90f3 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sat, 15 Apr 2023 21:10:57 +0200 Subject: [PATCH] fix including suspended users in getter --- packages/backend/src/server/api/common/getters.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/common/getters.ts b/packages/backend/src/server/api/common/getters.ts index b8788ddba..97059f987 100644 --- a/packages/backend/src/server/api/common/getters.ts +++ b/packages/backend/src/server/api/common/getters.ts @@ -33,7 +33,7 @@ export async function getUser(userId: User['id'], includeSuspended = false) { const user = await Users.findOneBy({ id: userId, isDeleted: false, - isSuspended: !includeSuspended, + ...(includeSuspended ? {} : {isSuspended: false}), }); if (user == null) { @@ -51,7 +51,7 @@ export async function getRemoteUser(userId: User['id'], includeSuspended = false id: userId, host: Not(IsNull()), isDeleted: false, - isSuspended: !includedSuspended, + ...(includeSuspended ? {} : {isSuspended: false}), }); if (user == null) { @@ -69,7 +69,7 @@ export async function getLocalUser(userId: User['id'], includeSuspended = false) id: userId, host: IsNull(), isDeleted: false, - isSuspended: !includeSuspended, + ...(includeSuspended ? {} : {isSuspended: false}), }); if (user == null) {