Add more endpoints for now page
This commit is contained in:
25
slices/main/views/recently_played_games/index.rb
Normal file
25
slices/main/views/recently_played_games/index.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
module Main
|
||||
module Views
|
||||
module RecentlyPlayedGames
|
||||
class Index < Main::View
|
||||
config.layout = false
|
||||
|
||||
include Deps["queries.posts.recent_games"]
|
||||
|
||||
expose :recently_played_games do |recently_played_result|
|
||||
# raise recently_played_result["data"].inspect
|
||||
recently_played_result.map do |game|
|
||||
{
|
||||
name: game["name"],
|
||||
playtime_forever: game["playtime_forever"].to_i / 60,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
private_expose :recently_played_result do
|
||||
recent_games.call
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user