Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
SOD/routes/admin/index.js

20 lines
607 B
JavaScript
Raw Normal View History

2020-08-17 19:04:50 +02:00
let express = require("express");
let router = express.Router();
let sessionCheck = require("../../middlewares/sessionCheck");
let models = require("../../models");
router.get("/", sessionCheck(3), async (req, res) => {
2020-08-17 19:13:00 +02:00
res.render("admin/index", {
title: "SOD - Administration",
sandwiches: await models.Sandwich.findAll(),
users: await models.User.findAll()
});
2020-08-20 11:48:28 +02:00
})
.use("/orders", require("./orders"))
2020-08-20 13:34:50 +02:00
.use("/sandwiches", require("./sandwiches"))
2020-08-20 14:50:59 +02:00
.use("/departments", require("./departments"))
.use("/users", require("./users"));
2020-08-17 19:04:50 +02:00
module.exports = router;