diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-03 22:53:01 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-03 22:53:01 +0200 |
commit | 48c1a155680d5471190ea116e29e9816e86ad8a9 (patch) | |
tree | 09b486ff559bdf702de82852fb88bcf48c6a3287 /api | |
parent | Merge pull request #411 from afeuerstein/master (diff) | |
download | server-48c1a155680d5471190ea116e29e9816e86ad8a9.tar.xz |
:bug: fix message reactions
Diffstat (limited to 'api')
-rw-r--r-- | api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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", |