feat: recursive sequel graph syncing with real-time UI polling

This commit is contained in:
2026-04-08 14:05:30 +02:00
parent a861729476
commit 8b46edc15a
7 changed files with 295 additions and 177 deletions

View File

@@ -328,6 +328,20 @@ func (h *Handler) HandleNotifications(w http.ResponseWriter, r *http.Request) {
return
}
templates.Notifications(watching).Render(r.Context(), w)
}
func (h *Handler) HandleNotificationsUpcoming(w http.ResponseWriter, r *http.Request) {
userID := ""
if user, ok := r.Context().Value(middleware.UserContextKey).(*database.User); ok && user != nil {
userID = user.ID
}
if userID == "" {
http.Error(w, "Unauthorized", http.StatusUnauthorized)
return
}
upcomingSeasons, err := h.svc.GetUpcomingSeasons(r.Context(), userID)
if err != nil {
log.Printf("upcoming seasons error: %v", err)
@@ -335,5 +349,5 @@ func (h *Handler) HandleNotifications(w http.ResponseWriter, r *http.Request) {
return
}
templates.Notifications(watching, upcomingSeasons).Render(r.Context(), w)
templates.UpcomingSeasonsList(upcomingSeasons).Render(r.Context(), w)
}