diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-05 19:52:42 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-05 19:52:42 +0200 |
commit | c3551d92543fd4ced618e2aac0be38f3ca9ee2df (patch) | |
tree | b7a8f2f948aa88d40d3b87f527b92458751398e2 /api/src/routes/users/@me/relationships.ts | |
parent | :art: reformatted (diff) | |
download | server-c3551d92543fd4ced618e2aac0be38f3ca9ee2df.tar.xz |
:bug: fix user projection
Diffstat (limited to 'api/src/routes/users/@me/relationships.ts')
-rw-r--r-- | api/src/routes/users/@me/relationships.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/api/src/routes/users/@me/relationships.ts b/api/src/routes/users/@me/relationships.ts index 567c734e..0c13cdba 100644 --- a/api/src/routes/users/@me/relationships.ts +++ b/api/src/routes/users/@me/relationships.ts @@ -18,7 +18,11 @@ const router = Router(); const userProjection: (keyof User)[] = ["relationships", ...PublicUserProjection]; router.get("/", route({}), async (req: Request, res: Response) => { - const user = await User.findOneOrFail({ where: { id: req.user_id }, relations: ["relationships", "relationships.to"] }); + const user = await User.findOneOrFail({ + where: { id: req.user_id }, + relations: ["relationships", "relationships.to"], + select: ["relationships"] + }); //TODO DTO const related_users = user.relationships.map((r) => { |