about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-11-14 18:33:13 -0600
committerStarfall <us@starfall.systems>2022-11-14 18:33:13 -0600
commitefa1bd9451c2aac68ce4576abdbbcdc266291f0f (patch)
tree4cfb9e485a912558e21032a77674562bf3fea635 /app/controllers/api
parentb07b6b9f339b604f9af150eb10ac1486eca8f189 (diff)
parentceafd1f68f1f1b57c998adf693678059f9aaa70c (diff)
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/base_controller.rb2
-rw-r--r--app/controllers/api/v2/admin/accounts_controller.rb2
-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!