fix: display error message when user or channel does not exists

This commit is contained in:
Lukian LEIZOUR 2025-04-18 18:39:56 +02:00
parent 17c6ab79ca
commit 2b2a38682a
5 changed files with 80 additions and 33 deletions

View file

@ -35,7 +35,7 @@ router.get('/:name', async (req, res) => {
if (channel[0]) {
res.send(channel[0]);
} else {
res.send('No channel found');
res.status(400).send({ error: 'No channel found' });
}
});