From 3b46b18ac3823435e586cac17281de931656b531 Mon Sep 17 00:00:00 2001 From: bytedefined <56295147+Bytedefined@users.noreply.github.com> Date: Sun, 31 Jul 2022 18:10:41 +0800 Subject: [PATCH] Add unpin message --- backend/routes/communications.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/routes/communications.js b/backend/routes/communications.js index d40e27d..0930ecb 100644 --- a/backend/routes/communications.js +++ b/backend/routes/communications.js @@ -615,6 +615,13 @@ router.post("/:id/pins", auth, async (req, res, next) => { res.json({ message: "Message unpinned successfully." }) + await createMessage( + req, + "pin", + `${req.user.username} unpinned a message from the chat.`, + chat, + req.user.id + ) return } const pin = await Pin.create({