refactor(server/api): migrate library/suggestions/radio/home preludes (A2 4/N)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user