diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-07 13:25:26 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-07 13:25:26 +0100 |
commit | fe57f6330f089d023f0fa4db7f7c8a51551d2ee9 (patch) | |
tree | 876f5ce296897d08baa98fe57007108bc97d79dc /app/controllers/api/statuses_controller.rb | |
parent | f099bc6091b55c598a55f252041cb3af6043caf4 (diff) |
API methods for retrieving home and mentions timelines
Diffstat (limited to 'app/controllers/api/statuses_controller.rb')
-rw-r--r-- | app/controllers/api/statuses_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/api/statuses_controller.rb b/app/controllers/api/statuses_controller.rb index b1633ab6c..82334a32f 100644 --- a/app/controllers/api/statuses_controller.rb +++ b/app/controllers/api/statuses_controller.rb @@ -20,4 +20,12 @@ class Api::StatusesController < ApiController @status = FavouriteService.new.(current_user.account, Status.find(params[:id])).status render action: :show end + + def home + @statuses = Status.where(account: [current_user.account] + current_user.account.following).order('created_at desc') + end + + def mentions + @statuses = Status.where(id: Mention.where(account: current_user.account).pluck(:status_id)).order('created_at desc') + end end |