about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-15 04:36:41 +0100
committerGitHub <noreply@github.com>2019-03-15 04:36:41 +0100
commitba84b6d4d7b2e1ccdcbfcdd5e0d09fbfdb241f45 (patch)
treedf510bf1efe17af68a5cfd9a1536c8bd21b9c46e /app/controllers/api
parent317c43b75be027f971c1c7e28890fdd37b63e931 (diff)
Add `visibility` param to reblog REST API (#9851)
Use async worker for creating reblog notification to improve performance
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/statuses/reblogs_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/api/v1/statuses/reblogs_controller.rb b/app/controllers/api/v1/statuses/reblogs_controller.rb
index 04847a6b7..ed4f55100 100644
--- a/app/controllers/api/v1/statuses/reblogs_controller.rb
+++ b/app/controllers/api/v1/statuses/reblogs_controller.rb
@@ -9,7 +9,7 @@ class Api::V1::Statuses::ReblogsController < Api::BaseController
   respond_to :json
 
   def create
-    @status = ReblogService.new.call(current_user.account, status_for_reblog)
+    @status = ReblogService.new.call(current_user.account, status_for_reblog, reblog_params)
     render json: @status, serializer: REST::StatusSerializer
   end
 
@@ -32,4 +32,8 @@ class Api::V1::Statuses::ReblogsController < Api::BaseController
   def status_for_destroy
     current_user.account.statuses.where(reblog_of_id: params[:status_id]).first!
   end
+
+  def reblog_params
+    params.permit(:visibility)
+  end
 end