mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 12:42:44 +01:00
Return none for dev portal + todo for categories
This commit is contained in:
parent
d4690aa7b6
commit
9f5c451cbc
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user