From 2f7182ca3d8568aca24a73a6b6dc8da0f5fa6747 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 3 Oct 2021 22:53:01 +0200 Subject: :bug: fix message reactions --- api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts b/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts index f2b83d40..6b6a66b2 100644 --- a/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts +++ b/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts @@ -124,7 +124,7 @@ router.put("/:emoji/:user_id", route({ permission: "READ_MESSAGE_HISTORY" }), as already_added.count++; } else message.reactions.push({ count: 1, emoji, user_ids: [req.user_id] }); - await Message.update({ id: message_id, channel_id }, message); + await message.save(); const member = channel.guild_id && (await Member.findOneOrFail({ id: req.user_id })); @@ -165,7 +165,7 @@ router.delete("/:emoji/:user_id", route({}), async (req: Request, res: Response) if (already_added.count <= 0) message.reactions.remove(already_added); - await Message.update({ id: message_id, channel_id }, message); + await message.save(); await emitEvent({ event: "MESSAGE_REACTION_REMOVE", -- cgit 1.4.1