diff options
Diffstat (limited to 'src/server/routes')
-rw-r--r-- | src/server/routes/index.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/server/routes/index.js b/src/server/routes/index.js index 7e97fea..d58962d 100644 --- a/src/server/routes/index.js +++ b/src/server/routes/index.js @@ -5,7 +5,7 @@ const getMeetingpointData = require('../lib/getMeetingpointData'); /* GET home page. */ router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], (req, res) => { - getMeetingpointData().then((data) => { + getMeetingpointData().then(({ users, dailyScheduleWeeks, basisScheduleWeeks }) => { const isBeta = process.env.BETA === '1'; const flags = []; @@ -17,10 +17,16 @@ router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], (req, res) => { } const flagsStr = `var FLAGS = ${JSON.stringify(flags)};`; - const usersStr = `var USERS = ${JSON.stringify(data.users)};`; - const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}`; + const usersStr = `var USERS = ${JSON.stringify(users)};`; + const dailyScheduleWeeksStr = `var DAGROOSTER_WEEKS = ${JSON.stringify(dailyScheduleWeeks)}`; + const basisScheduleWeeksStr = `var BASISROOSTER_WEEKS = ${JSON.stringify(basisScheduleWeeks)}`; - res.render('index', { flagsStr, usersStr, validWeekNumbersStr }); + res.render('index', { + flagsStr, + usersStr, + dailyScheduleWeeksStr, + basisScheduleWeeksStr, + }); }).catch(() => { console.error('Unable to get user info, emergency redirect!'); res.render('redirect'); |