diff --git a/Controller/ApiController.js b/Controller/ApiController.js index bc16d2a..4d4c864 100644 --- a/Controller/ApiController.js +++ b/Controller/ApiController.js @@ -9,6 +9,10 @@ module.exports = class ApiController { } single(req, res) { - res.send(this.db.getByID(req.query.id)) + if (req.query.id === '') { + res.send({ message: 'Identifiant incorrect' }) + } else { + res.send(this.db.getByID(req.query.id)) + } } } \ No newline at end of file