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
+2 -5
View File
@@ -4,7 +4,6 @@ import (
"errors"
"net/http"
"github.com/go-chi/chi/v5"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
@@ -119,14 +118,12 @@ func (h *handlers) handleGetArtist(w http.ResponseWriter, r *http.Request) {
// as a flat list. Used by ArtistCard's play affordance, which shuffles
// client-side. 404 when the artist doesn't exist.
func (h *handlers) handleGetArtistTracks(w http.ResponseWriter, r *http.Request) {
id, ok := parseUUID(chi.URLParam(r, "id"))
id, ok := requireURLUUID(w, r, "id")
if !ok {
writeErr(w, apierror.BadRequest("bad_request", "invalid artist id"))
return
}
user, ok := auth.UserFromContext(r.Context())
user, ok := requireUser(w, r)
if !ok {
writeErr(w, apierror.ErrUnauthorized)
return
}
q := dbq.New(h.pool)