🐛 fix user guilds

This commit is contained in:
Flam3rboy 2021-04-06 04:30:04 +02:00
parent 73aeca20de
commit af6f9b57ad
2 changed files with 6 additions and 1 deletions

View File

@ -165,6 +165,8 @@ router.post(
});
}
// TODO: save date_of_birth
// constructing final user object
// TODO fix:
// @ts-ignore
@ -179,6 +181,7 @@ router.post(
mfa_enabled: false,
verified: false,
email: adjusted_email,
nsfw_allowed: true, // TODO: depending on age
flags: 0n, // TODO: generate default flags
guilds: [],
user_data: {

View File

@ -16,7 +16,9 @@ export async function getPublicUser(user_id: bigint, additional_fields?: any) {
...PublicUserProjection,
...additional_fields,
}
).exec();
)
.lean()
.exec();
if (!user) throw new HTTPError("User not found", 404);
return user;
}