Update index.ts
This commit is contained in:
parent
28ccdb42e9
commit
488f6f3894
@ -214,10 +214,21 @@ router.delete("/:id", async (req: Request, res: Response) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.get("/:id/bans", async (req: Request, res: Response) => {
|
router.get("/:id/bans", async (req: Request, res: Response) => {
|
||||||
|
const guild = await GuildModel.findOne({ id: BigInt(req.params.id) }).exec();
|
||||||
|
|
||||||
|
if (!guild) throw new HTTPError("Guild not found", 404);
|
||||||
var bans = await BanModel.find({ guild_id: BigInt(req.params.id) }).exec();
|
var bans = await BanModel.find({ guild_id: BigInt(req.params.id) }).exec();
|
||||||
return res.json(bans);
|
return res.json(bans);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.get("/:id/members", async (req: Request, res: Response) => {
|
||||||
|
const guild = await GuildModel.findOne({ id: BigInt(req.params.id) }).exec();
|
||||||
|
|
||||||
|
if (!guild) throw new HTTPError("Guild not found", 404);
|
||||||
|
var members = await MemberModel.find({ guild_id: BigInt(req.params.id) }).exec();
|
||||||
|
return res.json(members);
|
||||||
|
});
|
||||||
|
|
||||||
router.post("/:id/bans/:userid", check(BanCreateSchema), async (req: Request, res: Response) => {
|
router.post("/:id/bans/:userid", check(BanCreateSchema), async (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
var guildID = BigInt(req.params.id);
|
var guildID = BigInt(req.params.id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user