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({
|
2022-11-03 20:38:20 -04:00
|
|
|
limit: 10,
|
|
|
|
order: [
|
|
|
|
['updatedAt', 'DESC'],
|
2022-11-03 22:28:01 -04:00
|
|
|
],
|
2022-11-03 20:38:20 -04:00
|
|
|
});
|
2022-11-02 14:29:46 -04:00
|
|
|
|
2022-11-04 17:30:17 -04:00
|
|
|
//req.flash('info', 'This is a test flash message.');
|
|
|
|
|
2022-11-02 14:29:46 -04:00
|
|
|
res.render('index.twig', {
|
|
|
|
inventory: items,
|
|
|
|
});
|
2022-11-01 23:55:07 -04:00
|
|
|
};
|