overseer/src/routes/home.js

19 lines
340 B
JavaScript
Raw Permalink Normal View History

2022-11-02 13:45:40 -04:00
const db = require('../models');
const Item = db.items;
2022-11-01 23:55:07 -04:00
// GET - /
2022-11-03 22:28:01 -04:00
exports.getIndex = async function(req, res) {
const items = await Item.findAll({
limit: 10,
order: [
['updatedAt', 'DESC'],
2022-11-03 22:28:01 -04:00
],
});
2022-11-04 17:54:43 -04:00
// req.flash('info', 'This is a test flash message.');
res.render('index.twig', {
inventory: items,
});
2022-11-01 23:55:07 -04:00
};