mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-28210] sqlstore/user_store: filter deleted users for GetProfilesInChannel (#15390)
* sqlstore/user_store: filter deleted users for GetProfilesInChannel * allow GetProfilesInChannel use userGetOptions * sqlstore/user_store: add more test cases * store/user_store: refine filter
This commit is contained in:
committed by
GitHub
parent
9c272f0b20
commit
e69a2a41ca
@@ -314,9 +314,17 @@ func (api *PluginAPI) UpdateUserStatus(userId, status string) (*model.Status, *m
|
||||
func (api *PluginAPI) GetUsersInChannel(channelId, sortBy string, page, perPage int) ([]*model.User, *model.AppError) {
|
||||
switch sortBy {
|
||||
case model.CHANNEL_SORT_BY_USERNAME:
|
||||
return api.app.GetUsersInChannel(channelId, page*perPage, perPage)
|
||||
return api.app.GetUsersInChannel(&model.UserGetOptions{
|
||||
InChannelId: channelId,
|
||||
Page: page,
|
||||
PerPage: perPage,
|
||||
})
|
||||
case model.CHANNEL_SORT_BY_STATUS:
|
||||
return api.app.GetUsersInChannelByStatus(channelId, page*perPage, perPage)
|
||||
return api.app.GetUsersInChannelByStatus(&model.UserGetOptions{
|
||||
InChannelId: channelId,
|
||||
Page: page,
|
||||
PerPage: perPage,
|
||||
})
|
||||
default:
|
||||
return nil, model.NewAppError("GetUsersInChannel", "plugin.api.get_users_in_channel", nil, "invalid sort option", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user