[MM-44159] Add user sort by admin status in channels (#20562)
Этот коммит содержится в:
@@ -652,7 +652,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if sort != "" && sort != "last_activity_at" && sort != "create_at" && sort != "status" {
|
||||
if sort != "" && sort != "last_activity_at" && sort != "create_at" && sort != "status" && sort != "admin" {
|
||||
c.SetInvalidURLParam("sort")
|
||||
return
|
||||
}
|
||||
@@ -667,6 +667,10 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
c.SetInvalidURLParam("sort")
|
||||
return
|
||||
}
|
||||
if sort == "admin" && inChannelId == "" {
|
||||
c.SetInvalidURLParam("sort")
|
||||
return
|
||||
}
|
||||
|
||||
withoutTeamBool, _ := strconv.ParseBool(withoutTeam)
|
||||
groupConstrainedBool, _ := strconv.ParseBool(groupConstrained)
|
||||
@@ -799,6 +803,8 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if sort == "status" {
|
||||
profiles, err = c.App.GetUsersInChannelPageByStatus(userGetOptions, c.IsSystemAdmin())
|
||||
} else if sort == "admin" {
|
||||
profiles, err = c.App.GetUsersInChannelPageByAdmin(userGetOptions, c.IsSystemAdmin())
|
||||
} else {
|
||||
profiles, err = c.App.GetUsersInChannelPage(userGetOptions, c.IsSystemAdmin())
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user