update: add who refused and who did not give answer yet in ics feed description
Some checks failed
CI/CD / test (push) Has been cancelled
CI/CD / build-and-push (push) Has been cancelled

This commit is contained in:
Nathan FONTEYNE 2026-07-31 12:19:13 +02:00
parent 3a56ef44c3
commit b056af78ac
3 changed files with 24 additions and 5 deletions

View file

@ -17,12 +17,16 @@ router.get(
const user = await usersRepo.findByIcsToken(req.params.token);
if (!user) return res.status(404).send('Not found');
const [rehearsals, settings] = await Promise.all([rehearsalsRepo.findUpcoming(), calendarRepo.getSlotSettings()]);
const [rehearsals, settings, allUsers] = await Promise.all([
rehearsalsRepo.findUpcoming(),
calendarRepo.getSlotSettings(),
usersRepo.findAllNames(),
]);
// req.protocol honors X-Forwarded-Proto here — see app.set('trust proxy', 1) in app.js.
const baseUrl = `${req.protocol}://${req.get('host')}`;
res
.type('text/calendar; charset=utf-8')
.send(buildRehearsalsFeed(rehearsals, { threshold: settings.rehearsalConfirmThreshold, baseUrl }));
.send(buildRehearsalsFeed(rehearsals, { threshold: settings.rehearsalConfirmThreshold, baseUrl, allUsers }));
})
);