diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-11-14 08:35:55 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-11-14 08:35:55 +0100 |
commit | 32c70d2f09e27c474b7e20ef3e3b34f5a7f50121 (patch) | |
tree | 117e952f835329eadc0095e809427f7af5be9631 /app/controllers/api | |
parent | 81b1d32d5b618daa4003b8de8292ae4dd3e656f6 (diff) | |
parent | b59ce0a60ff4f90bb16a8c3338ad37218af052b8 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/views/admin/announcements/edit.html.haml`: Upstream change too close to theming-related glitch-soc change. Ported upstream changes. - `app/views/admin/announcements/new.html.haml` Upstream change too close to theming-related glitch-soc change. Ported upstream changes.
Diffstat (limited to 'app/controllers/api')
-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! |