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 | 9f5c451cbc8bfb714479312c0cdc7349a836505f (patch) | |
tree | a366f6aa8c20469635b3fef378b0f9c2af8eb29a | |
parent | Fix primarycolum being assigned to nullable = true (diff) | |
download | server-9f5c451cbc8bfb714479312c0cdc7349a836505f.tar.xz |
Return none for dev portal + todo for categories
-rw-r--r-- | api/src/routes/users/@me/guilds.ts | 8 | ||||
-rw-r--r-- | util/src/entities/Categories.ts | 1 | ||||
-rw-r--r-- | util/src/entities/Guild.ts | 3 |
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; |