summary refs log tree commit diff
path: root/src/routes/guilds/#id/bans.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/guilds/#id/bans.ts')
-rw-r--r--src/routes/guilds/#id/bans.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/guilds/#id/bans.ts b/src/routes/guilds/#id/bans.ts

index e66ae3d4..5ac92154 100644 --- a/src/routes/guilds/#id/bans.ts +++ b/src/routes/guilds/#id/bans.ts
@@ -1,5 +1,5 @@ import { Request, Response, Router } from "express"; -import { BanModel, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, GuildModel } from "fosscord-server-util"; +import { BanModel, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, GuildModel, toObject } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; import { getIpAdress } from "../../../middlewares/GlobalRateLimit"; import { BanCreateSchema } from "../../../schema/Ban"; @@ -16,8 +16,8 @@ router.get("/", async (req: Request, res: Response) => { const guild = await GuildModel.findOne({ id: guild_id }).exec(); if (!guild) throw new HTTPError("Guild not found", 404); - var bans = await BanModel.find({ guild_id: guild_id }).lean().exec(); - return res.json(bans); + var bans = await BanModel.find({ guild_id: guild_id }).exec(); + return res.json(toObject(bans)); }); router.get("/:user", async (req: Request, res: Response) => {