mirror of
https://github.com/Aviortheking/IMIE_CQ.git
synced 2025-06-27 08:59:19 +00:00
Fait + correction de l'autre
This commit is contained in:
@ -5,15 +5,15 @@ module.exports = class ApiController {
|
||||
}
|
||||
|
||||
all(req, res) {
|
||||
res.send(this.db.getAll())
|
||||
res.status(200).json(this.db.getAll())
|
||||
}
|
||||
|
||||
single(req, res) {
|
||||
const entity = this.db.getByID(req.query.id)
|
||||
if (req.query.id === '' || !entity) {
|
||||
res.send({ message: 'Identifiant incorrect' })
|
||||
res.status(404).json({ message: 'Identifiant incorrect' })
|
||||
} else {
|
||||
res.send(entity)
|
||||
res.status(200).json(entity)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user