summary refs log tree commit diff
path: root/src/routes/channels
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:05:18 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:05:18 +0200
commitd774216bc8782484ac7b1c562b63aa9f30510177 (patch)
treedec4c6eeca227a873098a55a52193e088c600ef4 /src/routes/channels
parent:bug: fix routes user.user_data (diff)
downloadserver-d774216bc8782484ac7b1c562b63aa9f30510177.tar.xz
.lean() all mongodb requests
Diffstat (limited to 'src/routes/channels')
-rw-r--r--src/routes/channels/#channel_id/invites.ts2
-rw-r--r--src/routes/channels/#channel_id/messages/index.ts1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/routes/channels/#channel_id/invites.ts b/src/routes/channels/#channel_id/invites.ts

index 403ef36d..c9910ae2 100644 --- a/src/routes/channels/#channel_id/invites.ts +++ b/src/routes/channels/#channel_id/invites.ts
@@ -60,7 +60,7 @@ router.get("/", async (req: Request, res: Response) => { throw new HTTPError("You aren't authorised to access this endpoint", 401); } - const invites = await InviteModel.find({ guild_id: guID }).exec(); + const invites = await InviteModel.find({ guild_id: guID }).lean().exec(); res.status(200).send(invites); }); diff --git a/src/routes/channels/#channel_id/messages/index.ts b/src/routes/channels/#channel_id/messages/index.ts
index 590d7059..13c819b4 100644 --- a/src/routes/channels/#channel_id/messages/index.ts +++ b/src/routes/channels/#channel_id/messages/index.ts
@@ -72,6 +72,7 @@ router.get("/", async (req, res) => { .populate({ path: "mention_channels", select: { id: true, guild_id: true, type: true, name: true } }) .populate("mention_roles") // .populate({ path: "member", select: PublicMemberProjection }) + .lean() .exec(); return res.json(messages);