refactor(server/api): migrate admin_smtp/admin_tracks + playlist refresh preludes (A2 6/N)
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
|
||||
"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/playlists"
|
||||
)
|
||||
@@ -36,9 +35,8 @@ type foryouRefreshResp struct {
|
||||
// Authenticated user only — each user refreshes only their own
|
||||
// For-You.
|
||||
func (h *handlers) handleForYouRefresh(w http.ResponseWriter, r *http.Request) {
|
||||
user, ok := auth.UserFromContext(r.Context())
|
||||
user, ok := requireUser(w, r)
|
||||
if !ok {
|
||||
writeErr(w, apierror.Unauthorized("auth_required", ""))
|
||||
return
|
||||
}
|
||||
if err := playlists.BuildSystemPlaylists(r.Context(), h.pool, h.logger, user.ID, time.Now(), h.dataDir); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user