[MM-26532] Support "active" filter on profile search (#14923)

* Support "active" filter on profile search

* Add tests for active user filter
Этот коммит содержится в:
Michael Kochell
2020-06-29 15:52:46 -04:00
коммит произвёл GitHub
родитель bec2f366a7
Коммит 11bc28b5fb
6 изменённых файлов: 115 добавлений и 0 удалений

Просмотреть файл

@@ -533,6 +533,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
groupConstrained := r.URL.Query().Get("group_constrained")
withoutTeam := r.URL.Query().Get("without_team")
inactive := r.URL.Query().Get("inactive")
active := r.URL.Query().Get("active")
role := r.URL.Query().Get("role")
sort := r.URL.Query().Get("sort")
@@ -560,6 +561,11 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
withoutTeamBool, _ := strconv.ParseBool(withoutTeam)
groupConstrainedBool, _ := strconv.ParseBool(groupConstrained)
inactiveBool, _ := strconv.ParseBool(inactive)
activeBool, _ := strconv.ParseBool(active)
if inactiveBool && activeBool {
c.SetInvalidUrlParam("inactive")
}
restrictions, err := c.App.GetViewUsersRestrictions(c.App.Session().UserId)
if err != nil {
@@ -576,6 +582,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
GroupConstrained: groupConstrainedBool,
WithoutTeam: withoutTeamBool,
Inactive: inactiveBool,
Active: activeBool,
Role: role,
Sort: sort,
Page: c.Params.Page,