From 92ea1d6b2118b1a2a64bb022f116b137c4b9d6fc Mon Sep 17 00:00:00 2001 From: Lukian Date: Mon, 12 May 2025 10:40:23 +0200 Subject: [PATCH] fix:: fixed unexistant function in message deletion --- back/api/messages.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/back/api/messages.js b/back/api/messages.js index d692a67..9ef2db5 100644 --- a/back/api/messages.js +++ b/back/api/messages.js @@ -126,19 +126,11 @@ router.post('/:message_id/delete', checkAuth, async (req, res) => { } const channel = await getChannel(connection, message[0].channel_name); - if (user.id !== channel[0].owner_id && user.id !== message[0].user_id && user.admin !== 1) { connection.end(); return res.status(401).send({ error: 'Unauthorized' }); } - if (message[0].reply_to_id) { - const replies = await getMessageReplies(connection, message[0].reply_to_id); - if (replies.length === 1) { - await setHasReplies(connection, replyToId, false); - } - } - await deleteMessage(connection, message_id); connection.end();