fix: fixed message deleting

This commit is contained in:
Lukian 2025-04-03 12:43:05 +02:00
parent 2f54840785
commit 1d4a13f372

View file

@ -84,7 +84,7 @@ router.post('/:name/messages/delete', async (req, res) => {
return res.status(400).send({ error: 'No channel found' });
}
if (user.id !== channel[0].owner_id && user.id !== message.user_id && user.admin !== 1) {
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' });
}