From fcde0790238799d7656f67135f3f1163b29e0efc Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 21 Apr 2022 16:48:13 +0000 Subject: [PATCH] Add route for reports page, with test data --- routes/report.js | 49 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/routes/report.js b/routes/report.js index 830c801..9f2d718 100644 --- a/routes/report.js +++ b/routes/report.js @@ -3,21 +3,56 @@ const express = require('express'); const router = express.Router(); -router.get('/reports', (req, res, next) => { - /* eslint-disable multiline-comment-style */ - /* +router.get('/reports', (req, res) => { return res.render('reports', { ...req.hbsContext, title: 'Stratos - Reports', - current: 'Reports' + current: 'Reports', + types: [ + { + key: 'student', + value: 'Student' + }, + { + key: 'class', + value: 'Class' + } + ], + targets: JSON.stringify({ + student: [ + { + id: '1', + name: 'joe' + } + ], + class: [ + { + id: '1', + name: 'joeseph' + }, + { + id: '2', + name: 'bob' + }, + { + id: '3', + name: 'fred' + }, + { + id: '4', + name: 'mike' + } + ] + }) }); - */ - /* eslint-enable multiline-comment-style */ +}); - next(); +router.post('/report/generate', (req, res) => { + return res.redirect('/admin/reports'); }); module.exports = { root: '/admin', router: router }; +