From a12b2ad57af11c8be5eb1a2fbd776d5da209bbfa Mon Sep 17 00:00:00 2001 From: Essem Date: Tue, 23 Jan 2024 22:59:42 -0600 Subject: [PATCH] Simplify reactions API controller --- .../api/v1/statuses/reactions_controller.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/controllers/api/v1/statuses/reactions_controller.rb b/app/controllers/api/v1/statuses/reactions_controller.rb index 2d7e4f5984..c4b0fa307f 100644 --- a/app/controllers/api/v1/statuses/reactions_controller.rb +++ b/app/controllers/api/v1/statuses/reactions_controller.rb @@ -1,11 +1,8 @@ # frozen_string_literal: true -class Api::V1::Statuses::ReactionsController < Api::BaseController - include Authorization - +class Api::V1::Statuses::ReactionsController < Api::V1::Statuses::BaseController before_action -> { doorkeeper_authorize! :write, :'write:favourites' } before_action :require_user! - before_action :set_status def create ReactService.new.call(current_account, @status, params[:id]) @@ -19,13 +16,4 @@ class Api::V1::Statuses::ReactionsController < Api::BaseController rescue Mastodon::NotPermittedError not_found end - - private - - def set_status - @status = Status.find(params[:status_id]) - authorize @status, :show? - rescue Mastodon::NotPermittedError - not_found - end end