From 6d3e51482995399502215df23748a068131539fb Mon Sep 17 00:00:00 2001 From: Florian Bouillon Date: Fri, 3 Jul 2020 11:23:31 +0200 Subject: [PATCH] Fait :D --- Controller/ApiController.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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