summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--api/src/routes/users/@me/guilds.ts8
-rw-r--r--util/src/entities/Categories.ts1
-rw-r--r--util/src/entities/Guild.ts3
3 files changed, 11 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
diff --git a/util/src/entities/Categories.ts b/util/src/entities/Categories.ts
index a3c1280f..81fbc303 100644
--- a/util/src/entities/Categories.ts
+++ b/util/src/entities/Categories.ts
@@ -13,6 +13,7 @@ import { BaseClassWithoutId } from "./BaseClass";
 // 	},
 // 	"is_primary": false/true
 // }]
+// Also populate discord default categories
 
 @Entity("categories")
 export class Categories extends BaseClassWithoutId { // Not using snowflake
diff --git a/util/src/entities/Guild.ts b/util/src/entities/Guild.ts
index 18fa7a0a..9ac148ee 100644
--- a/util/src/entities/Guild.ts
+++ b/util/src/entities/Guild.ts
@@ -270,6 +270,9 @@ export class Guild extends BaseClass {
 	@Column({ nullable: true })
 	nsfw?: boolean;
 
+	// only for developer portal
+	permissions?: number;
+
 	static async createGuild(body: {
 		name?: string;
 		icon?: string | null;