summary refs log tree commit diff
path: root/api/src/routes/users/@me
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-02-16 21:16:20 +0300
committerGitHub <noreply@github.com>2022-02-16 21:16:20 +0300
commitc9fdfe196d743ecc5ca8a9ec98f1a3a436b7a20f (patch)
tree80d802d0f8f411425f6dbbf4c35c3e1bd3218b02 /api/src/routes/users/@me
parentTypo (diff)
parentReturn none for dev portal + todo for categories (diff)
downloadserver-c9fdfe196d743ecc5ca8a9ec98f1a3a436b7a20f.tar.xz
Merge pull request #608 from Featyre/master
Branding updates + Fixed Discovery and custom status + Dev portal
Diffstat (limited to 'api/src/routes/users/@me')
-rw-r--r--api/src/routes/users/@me/guilds.ts8
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