generated from lucien/api-template
fix: display error message when user or channel does not exists
This commit is contained in:
parent
17c6ab79ca
commit
2b2a38682a
5 changed files with 80 additions and 33 deletions
|
@ -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' });
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue