Add unpin message

This commit is contained in:
bytedefined 2022-07-31 18:10:41 +08:00 committed by GitHub
parent 5ee4af70ab
commit 3b46b18ac3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -615,6 +615,13 @@ router.post("/:id/pins", auth, async (req, res, next) => {
res.json({ res.json({
message: "Message unpinned successfully." message: "Message unpinned successfully."
}) })
await createMessage(
req,
"pin",
`${req.user.username} unpinned a message from the chat.`,
chat,
req.user.id
)
return return
} }
const pin = await Pin.create({ const pin = await Pin.create({