feat(api): register cover + stream routes under RequireUser
This commit is contained in:
@@ -28,7 +28,9 @@ func Mount(r chi.Router, pool *pgxpool.Pool, logger *slog.Logger) {
|
||||
authed.Get("/artists", h.handleListArtists)
|
||||
authed.Get("/artists/{id}", h.handleGetArtist)
|
||||
authed.Get("/albums/{id}", h.handleGetAlbum)
|
||||
authed.Get("/albums/{id}/cover", h.handleGetCover)
|
||||
authed.Get("/tracks/{id}", h.handleGetTrack)
|
||||
authed.Get("/tracks/{id}/stream", h.handleGetStream)
|
||||
authed.Get("/search", h.handleSearch)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -439,7 +439,9 @@ func TestRoutesRegisteredInMount(t *testing.T) {
|
||||
"/api/artists",
|
||||
"/api/artists/00000000-0000-0000-0000-000000000001",
|
||||
"/api/albums/00000000-0000-0000-0000-000000000001",
|
||||
"/api/albums/00000000-0000-0000-0000-000000000001/cover",
|
||||
"/api/tracks/00000000-0000-0000-0000-000000000001",
|
||||
"/api/tracks/00000000-0000-0000-0000-000000000001/stream",
|
||||
"/api/search?q=x",
|
||||
}
|
||||
for _, p := range paths {
|
||||
|
||||
Reference in New Issue
Block a user