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);
}
|