Add top track to weekly post

This commit is contained in:
2023-03-05 22:54:18 +11:00
parent ea9d092505
commit 03bf0eca9f
9 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
module Adamantium
module Actions
module Posts
class TopTracks < Action
include Deps["views.posts.top_tracks", query: "queries.posts.top_tracks"]
def handle(req, res)
res.content_type = "Application/JSON"
res.status = 200
tracks = query.call(slug: req.params[:slug])
track = if tracks.is_a? Array
tracks.first
else
tracks
end
if track
res.render top_tracks, track: track
end
end
end
end
end
end