diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:55:23 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:55:23 +0200 |
commit | 5d820f35347fe328605edfbcce9e26dcbf75af07 (patch) | |
tree | 05b8c49c2f93134c5f3adcd01d6bf1f8228db8ae /api/src/routes/channels | |
parent | :sparkles: typeorm error handler (diff) | |
download | server-5d820f35347fe328605edfbcce9e26dcbf75af07.tar.xz |
:bug: fix message sending
Diffstat (limited to 'api/src/routes/channels')
-rw-r--r-- | api/src/routes/channels/#channel_id/messages/#message_id/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts index 32478763..b9d46c4f 100644 --- a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts +++ b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts @@ -20,7 +20,9 @@ router.patch("/", check(MessageCreateSchema), async (req: Request, res: Response body = { flags: body.flags }; // admins can only suppress embeds of other messages } - const opts = await handleMessage({ + const new_message = await handleMessage({ + // TODO: should be message_reference overridable? + // @ts-ignore message_reference: message.message_reference, ...body, author_id: message.author_id, @@ -28,10 +30,9 @@ router.patch("/", check(MessageCreateSchema), async (req: Request, res: Response id: message_id, edited_timestamp: new Date() }); - message.assign(opts); await Promise.all([ - message.save(), + new_message.save(), await emitEvent({ event: "MESSAGE_UPDATE", channel_id, |