generated from lucien/api-template
fix: fixed message deleting
This commit is contained in:
parent
2f54840785
commit
1d4a13f372
1 changed files with 1 additions and 1 deletions
|
@ -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' });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue