19 lines
643 B
TypeScript
19 lines
643 B
TypeScript
const express = require('express');
|
|
const router = express.Router();
|
|
const Boxes = require('../Models/Boxes.ts');
|
|
const Inventory = require('../Models/Inventory.ts');
|
|
|
|
router.get('/', async (req, res) => {
|
|
// get boxes and pass them to the
|
|
const boxes = await Boxes.findAll({include: Inventory}); // retrieve all inventory records
|
|
// await console.log(boxes);
|
|
await res.render('boxes', { boxes });
|
|
});
|
|
|
|
router.post('/:skuToEdit', async (req, res) => {
|
|
const skuToEdit = req.params.skuToEdit;
|
|
// update or retrieve data for this SKU and redirect back to boxes page with updated information
|
|
});
|
|
|
|
module.exports = router;
|