Added a page to view info about an item
This commit is contained in:
@ -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');
|
||||
|
Reference in New Issue
Block a user