Add back `Admin::GroupsController#index` route for now.

* The endpoint is being used by discourse_api.
This commit is contained in:
Guo Xiang Tan 2017-08-03 00:24:23 +09:00
parent be30d4510a
commit 33e22cf598
1 changed files with 14 additions and 0 deletions

View File

@ -1,4 +1,18 @@
class Admin::GroupsController < Admin::AdminController class Admin::GroupsController < Admin::AdminController
def index
groups = Group.order(:name).where("groups.id <> ?", Group::AUTO_GROUPS[:everyone])
if search = params[:search].to_s
groups = groups.where("name ILIKE ?", "%#{search}%")
end
if params[:ignore_automatic].to_s == "true"
groups = groups.where(automatic: false)
end
render_serialized(groups, BasicGroupSerializer)
end
def show def show
render nothing: true render nothing: true
end end