fix(calendar): apply ICS visibility filter to /upcoming endpoint

This commit is contained in:
Ulas Kalayci
2026-04-20 23:55:20 +02:00
parent 466860074a
commit ed0618cf75
+7 -1
View File
@@ -190,8 +190,14 @@ router.get('/upcoming', (req, res) => {
OR OR
(e.recurrence_rule IS NOT NULL AND DATE(e.start_datetime) <= ?) (e.recurrence_rule IS NOT NULL AND DATE(e.start_datetime) <= ?)
) )
AND (
e.external_source != 'ics'
OR e.subscription_id IN (
SELECT id FROM ics_subscriptions WHERE shared = 1 OR created_by = ?
)
)
ORDER BY e.start_datetime ASC ORDER BY e.start_datetime ASC
`).all(nowDate, future, future); `).all(nowDate, future, future, req.session.userId);
const expanded = expandRecurringEvents(rawEvents, nowDate, future) const expanded = expandRecurringEvents(rawEvents, nowDate, future)
.filter((e) => e.start_datetime >= new Date().toISOString()) .filter((e) => e.start_datetime >= new Date().toISOString())