Added a page to view info about an item
This commit is contained in:
1 parent
1b46e7c3fb
commit
4a0241dd2b
4 files changed
+49
-1
No files matched your search
@@ -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