diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api/base_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/api/v2/admin/accounts_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/api/v2/filters/keywords_controller.rb (renamed from app/controllers/api/v1/filters/keywords_controller.rb) | 2 | ||||
-rw-r--r-- | app/controllers/api/v2/filters/statuses_controller.rb (renamed from app/controllers/api/v1/filters/statuses_controller.rb) | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index 3f3e1ca7b..665425f29 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -57,7 +57,7 @@ class Api::BaseController < ApplicationController render json: { error: I18n.t('errors.429') }, status: 429 end - rescue_from ActionController::ParameterMissing do |e| + rescue_from ActionController::ParameterMissing, Mastodon::InvalidParameterError do |e| render json: { error: e.to_s }, status: 400 end diff --git a/app/controllers/api/v2/admin/accounts_controller.rb b/app/controllers/api/v2/admin/accounts_controller.rb index bcc1a0733..b25831aa0 100644 --- a/app/controllers/api/v2/admin/accounts_controller.rb +++ b/app/controllers/api/v2/admin/accounts_controller.rb @@ -33,7 +33,7 @@ class Api::V2::Admin::AccountsController < Api::V1::Admin::AccountsController end def filter_params - params.permit(*FILTER_PARAMS) + params.permit(*FILTER_PARAMS, role_ids: []) end def pagination_params(core_params) diff --git a/app/controllers/api/v1/filters/keywords_controller.rb b/app/controllers/api/v2/filters/keywords_controller.rb index d3718a137..c63e1d986 100644 --- a/app/controllers/api/v1/filters/keywords_controller.rb +++ b/app/controllers/api/v2/filters/keywords_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Api::V1::Filters::KeywordsController < Api::BaseController +class Api::V2::Filters::KeywordsController < Api::BaseController before_action -> { doorkeeper_authorize! :read, :'read:filters' }, only: [:index, :show] before_action -> { doorkeeper_authorize! :write, :'write:filters' }, except: [:index, :show] before_action :require_user! diff --git a/app/controllers/api/v1/filters/statuses_controller.rb b/app/controllers/api/v2/filters/statuses_controller.rb index b6bed306f..755c14cff 100644 --- a/app/controllers/api/v1/filters/statuses_controller.rb +++ b/app/controllers/api/v2/filters/statuses_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Api::V1::Filters::StatusesController < Api::BaseController +class Api::V2::Filters::StatusesController < Api::BaseController before_action -> { doorkeeper_authorize! :read, :'read:filters' }, only: [:index, :show] before_action -> { doorkeeper_authorize! :write, :'write:filters' }, except: [:index, :show] before_action :require_user! |