Skip to content

Commit bccd821

Browse files
committed
hook up recommended to trending endpoint?
1 parent e8e2c7c commit bccd821

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

api/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ func NewApiServer(config config.Config) *ApiServer {
149149
// Tracks
150150
g.Get("/tracks", app.v1Tracks)
151151

152-
g.Get("/tracks/trending", app.v1Trending)
152+
g.Get("/tracks/trending", app.v1TracksTrending)
153+
g.Get("/tracks/recommended", app.v1TracksTrending)
153154

154155
g.Use("/tracks/:trackId", app.requireTrackIdMiddleware)
155156
g.Get("/tracks/:trackId", app.v1Track)
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/jackc/pgx/v5"
77
)
88

9-
func (app *ApiServer) v1Trending(c *fiber.Ctx) error {
9+
func (app *ApiServer) v1TracksTrending(c *fiber.Ctx) error {
1010
myId := app.getMyId(c)
1111

1212
// SQL query with conditional genre filter
@@ -40,10 +40,6 @@ func (app *ApiServer) v1Trending(c *fiber.Ctx) error {
4040
return err
4141
}
4242

43-
type trackTrendingRow struct {
44-
TrackId int32 `json:"track_id"`
45-
}
46-
4743
trackIds, err := pgx.CollectRows(rows, pgx.RowTo[int32])
4844
if err != nil {
4945
return err

0 commit comments

Comments
 (0)