fix including suspended users in getter

This commit is contained in:
Johann150 2023-04-15 21:10:57 +02:00
parent 9a085e9d42
commit ba2b7ef43c
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -33,7 +33,7 @@ export async function getUser(userId: User['id'], includeSuspended = false) {
const user = await Users.findOneBy({ const user = await Users.findOneBy({
id: userId, id: userId,
isDeleted: false, isDeleted: false,
isSuspended: !includeSuspended, ...(includeSuspended ? {} : {isSuspended: false}),
}); });
if (user == null) { if (user == null) {
@ -51,7 +51,7 @@ export async function getRemoteUser(userId: User['id'], includeSuspended = false
id: userId, id: userId,
host: Not(IsNull()), host: Not(IsNull()),
isDeleted: false, isDeleted: false,
isSuspended: !includedSuspended, ...(includeSuspended ? {} : {isSuspended: false}),
}); });
if (user == null) { if (user == null) {
@ -69,7 +69,7 @@ export async function getLocalUser(userId: User['id'], includeSuspended = false)
id: userId, id: userId,
host: IsNull(), host: IsNull(),
isDeleted: false, isDeleted: false,
isSuspended: !includeSuspended, ...(includeSuspended ? {} : {isSuspended: false}),
}); });
if (user == null) { if (user == null) {