mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: raise invalid params for bad callback
Corrects it so we raise a 400 instead of logged 500 error
This commit is contained in:
@ -69,7 +69,11 @@ class GroupsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
if type = params[:type]&.to_sym
|
if type = params[:type]&.to_sym
|
||||||
groups = TYPE_FILTERS[type].call(groups, current_user)
|
callback = TYPE_FILTERS[type]
|
||||||
|
if !callback
|
||||||
|
raise Discourse::InvalidParameters.new(:type)
|
||||||
|
end
|
||||||
|
groups = callback.call(groups, current_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
if current_user
|
if current_user
|
||||||
|
Reference in New Issue
Block a user