summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-31 15:09:52 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-31 15:09:52 +1100
commit97445fc399dc39c663a21625b3d9dfd1d6bd1438 (patch)
tree7fe9649501b86e44e0e500c78d6b667d221b6bd8
parentAllow running api, cdn, gateway separately (diff)
downloadserver-97445fc399dc39c663a21625b3d9dfd1d6bd1438.tar.xz
Fix message patching sending old message rather than updated one
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
index 47faba73..6fccac30 100644
--- a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
+++ b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
@@ -82,7 +82,7 @@ router.patch(
 		});
 
 		await Promise.all([
-			new_message!.save(),
+			new_message.save(),
 			await emitEvent({
 				event: "MESSAGE_UPDATE",
 				channel_id,
@@ -90,9 +90,9 @@ router.patch(
 			} as MessageUpdateEvent),
 		]);
 
-		postHandleMessage(message);
+		postHandleMessage(new_message);
 
-		return res.json(message);
+		return res.json(new_message);
 	},
 );