update: different colors for suggested rehersal and validated rehersal

This commit is contained in:
Nathan FONTEYNE 2026-08-11 11:44:42 +02:00
parent b056af78ac
commit a3d62200ce
10 changed files with 102 additions and 24 deletions

View file

@ -12,6 +12,7 @@ router.get(
asyncHandler(async (req, res) => {
const [rehearsals, settings] = await Promise.all([rehearsalsRepo.findUpcoming(), calendarRepo.getSlotSettings()]);
const threshold = settings.rehearsalConfirmThreshold;
const hostUserId = settings.rehearsalHostUserId;
res.json(
rehearsals.map((r) => ({
id: r.id,
@ -21,8 +22,10 @@ router.get(
proposedBy: r.proposed_by,
proposedByName: r.proposed_by_name,
votes: r.votes,
status: computeRehearsalStatus(r.votes, threshold),
status: computeRehearsalStatus(r.votes, threshold, hostUserId),
confirmThreshold: threshold,
hostUserId,
hostName: settings.rehearsalHostName,
}))
);
})