FEATURE: Add non_automatic group type param to groups index API

This commit is contained in:
Angus McLeod
2020-10-21 09:46:45 +11:00
committed by GitHub
parent dc2f5064e2
commit 516e7e392b
2 changed files with 17 additions and 2 deletions

View File

@ -34,6 +34,9 @@ class GroupsController < ApplicationController
},
automatic: Proc.new { |groups|
groups.where(automatic: true)
},
non_automatic: Proc.new { |groups|
groups.where(automatic: false)
}
}
ADD_MEMBERS_LIMIT = 1000
@ -82,6 +85,8 @@ class GroupsController < ApplicationController
type_filters = type_filters - [:my, :owner]
end
type_filters.delete(:non_automatic)
# count the total before doing pagination
total = groups.count