[MM-26532] Support "active" filter on profile search (#14923)
* Support "active" filter on profile search * Add tests for active user filter
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bec2f366a7
Коммит
11bc28b5fb
@@ -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,
|
||||
|
||||
Ссылка в новой задаче
Block a user