Added a page to view info about an item

This commit is contained in:
2022-11-02 23:23:20 -04:00
parent 1b46e7c3fb
commit 4a0241dd2b
4 changed files with 49 additions and 1 deletions

View File

@ -1,6 +1,17 @@
const db = require('../models');
const Item = db.items;
// GET - /item/{name}
exports.getItem = async function (req, res) {
const item = await Item.findAll({ where: {
id: req.params.id,
}});
res.render('item/view.twig', {
item: item[0],
});
};
// GET - /item/add
exports.getAdd = async function (req, res) {
res.render('item/add.twig');