From 01149d8da7ff7428eb0aa23b3adcc874e57681a9 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Thu, 3 Nov 2022 20:38:20 -0400 Subject: [PATCH] Added a record limiter to the main home view --- src/routes/home.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/routes/home.js b/src/routes/home.js index 9757ef2..864dfd3 100644 --- a/src/routes/home.js +++ b/src/routes/home.js @@ -3,7 +3,12 @@ const Item = db.items; // GET - / exports.getIndex = async function (req, res) { - let items = await Item.findAll({}); + let items = await Item.findAll({ + limit: 10, + order: [ + ['updatedAt', 'DESC'], + ] + }); res.render('index.twig', { inventory: items,