diff options
author | Featyre <twooter.0g179@simplelogin.co> | 2022-02-02 02:09:57 +0800 |
---|---|---|
committer | Featyre <twooter.0g179@simplelogin.co> | 2022-02-02 02:09:57 +0800 |
commit | 7b3531cb9015ec5bdf95c97b726d5d64f2ca41fa (patch) | |
tree | de032abacef366ba7b9f19b4d9131e2dc22d20c7 /api/src | |
parent | Fix primarycolum being assigned to nullable = true (diff) | |
download | server-7b3531cb9015ec5bdf95c97b726d5d64f2ca41fa.tar.xz |
Return none for dev portal + todo for categories
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/routes/users/@me/guilds.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/api/src/routes/users/@me/guilds.ts b/api/src/routes/users/@me/guilds.ts index 22a2c04c..754a240e 100644 --- a/api/src/routes/users/@me/guilds.ts +++ b/api/src/routes/users/@me/guilds.ts @@ -8,7 +8,13 @@ const router: Router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { const members = await Member.find({ relations: ["guild"], where: { id: req.user_id } }); - res.json(members.map((x) => x.guild)); + let guild = members.map((x) => x.guild); + + if ("with_counts" in req.query && req.query.with_counts == "true") { + guild = []; // TODO: Load guilds with user role permissions number + } + + res.json(guild); }); // user send to leave a certain guild |