Adding views for the profile and entry pages
This commit is contained in:
parent
f16b31f077
commit
24646d5769
13 changed files with 177 additions and 7 deletions
|
|
@ -46,5 +46,9 @@ module Mastodon
|
|||
expose :updated_at
|
||||
end
|
||||
end
|
||||
|
||||
class StreamEntry < Grape::Entity
|
||||
expose :activity, using: Mastodon::Entities::Status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@ module Mastodon
|
|||
version 'v1', using: :path
|
||||
format :json
|
||||
|
||||
helpers do
|
||||
def current_user
|
||||
User.first
|
||||
end
|
||||
end
|
||||
|
||||
resource :timelines do
|
||||
desc 'Return a public timeline'
|
||||
|
||||
|
|
@ -13,7 +19,7 @@ module Mastodon
|
|||
desc 'Return the home timeline of a logged in user'
|
||||
|
||||
get :home do
|
||||
# todo
|
||||
present current_user.timeline, with: Mastodon::Entities::StreamEntry
|
||||
end
|
||||
|
||||
desc 'Return the notifications timeline of a logged in user'
|
||||
|
|
|
|||
Reference in a new issue