summary refs log tree commit diff
path: root/src/util/User.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-07 03:03:27 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-07 03:03:27 +0200
commitb32beb0b9c9f19a3444d87aa7369912e54befa90 (patch)
tree5b473c39b023a0cff92338f2a2314fd5def966f9 /src/util/User.ts
parent:loud_sound: log gateway events (diff)
downloadserver-b32beb0b9c9f19a3444d87aa7369912e54befa90.tar.xz
:bug: fix lean not working with virtuals
Diffstat (limited to 'src/util/User.ts')
-rw-r--r--src/util/User.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/User.ts b/src/util/User.ts

index 70098bb5..05213642 100644 --- a/src/util/User.ts +++ b/src/util/User.ts
@@ -1,4 +1,4 @@ -import { UserModel } from "fosscord-server-util"; +import { toObject, UserModel } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; export const PublicUserProjection = { @@ -16,9 +16,7 @@ export async function getPublicUser(user_id: string, additional_fields?: any) { ...PublicUserProjection, ...additional_fields, } - ) - .lean() - .exec(); + ).exec(); if (!user) throw new HTTPError("User not found", 404); - return user; + return toObject(user); }