From 5b0cef9781af519a0a6ace1f429162ae05863bde Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 16 Sep 2016 00:21:51 +0200 Subject: Setting up preliminary "detailed" routes in the UI, new API end-point for fetching status context --- app/controllers/api/statuses_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/api/statuses_controller.rb b/app/controllers/api/statuses_controller.rb index 0ef56580c..90e78a542 100644 --- a/app/controllers/api/statuses_controller.rb +++ b/app/controllers/api/statuses_controller.rb @@ -6,6 +6,12 @@ class Api::StatusesController < ApiController @status = Status.find(params[:id]) end + def context + @status = Status.find(params[:id]) + @ancestors = @status.ancestors.with_includes.with_counters + @descendants = @status.descendants.with_includes.with_counters + end + def create @status = PostStatusService.new.(current_user.account, params[:status], params[:in_reply_to_id].blank? ? nil : Status.find(params[:in_reply_to_id]), params[:media_ids]) render action: :show -- cgit