From a96c3bc9177ef34d76a616f61eaf4f9a64ead363 Mon Sep 17 00:00:00 2001 From: Bobby Date: Mon, 25 Apr 2022 15:27:15 -0400 Subject: render ejs template --- interface/controllers/citizens.controller.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'interface/controllers/citizens.controller.js') diff --git a/interface/controllers/citizens.controller.js b/interface/controllers/citizens.controller.js index fef549d..64522b1 100644 --- a/interface/controllers/citizens.controller.js +++ b/interface/controllers/citizens.controller.js @@ -3,15 +3,9 @@ const citizens = db.citizens; const op = db.Sequelize.Op; // Retrieve all citizens from the database. Limit the number of citizens returned to 10. -exports.findXCitizens = (req, res) => { +exports.findXCitizens = () => { const limit = 10; - citizens.findAll({ + return citizens.findAll({ limit: limit - }).then(citizens => { - res.send(citizens); - }).catch(err => { - res.status(500).send({ - message: err.message || "Some error occurred while retrieving citizens." - }); }); } -- cgit v1.2.3