refactor(server/api): migrate library/suggestions/radio/home preludes (A2 4/N)

This commit is contained in:
2026-05-08 08:43:36 -04:00
parent dde3dd2804
commit 79c3ec3659
4 changed files with 5 additions and 14 deletions
+1 -3
View File
@@ -4,7 +4,6 @@ import (
"net/http"
"git.fabledsword.com/bvandeusen/minstrel/internal/apierror"
"git.fabledsword.com/bvandeusen/minstrel/internal/auth"
"git.fabledsword.com/bvandeusen/minstrel/internal/db/dbq"
"git.fabledsword.com/bvandeusen/minstrel/internal/recommendation"
)
@@ -14,9 +13,8 @@ import (
// DB failure — the SPA should render either empty states or full content,
// not a half-broken page.
func (h *handlers) handleGetHome(w http.ResponseWriter, r *http.Request) {
user, ok := auth.UserFromContext(r.Context())
user, ok := requireUser(w, r)
if !ok {
writeErr(w, apierror.ErrUnauthorized)
return
}
data, err := recommendation.HomeData(r.Context(), h.pool, user.ID)