[MM-13500] Adds channel /search_group endpoint (#10805)
* [MM-13500] Adds channel /search_group endpoint * Add LIMIT to the queries * Fix i18n extract * Fix tests * Add a new endpoint to get profiles by group channel ids * Rebase fix
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
604e247135
Коммит
9e9b008f3d
12
app/user.go
12
app/user.go
@@ -637,6 +637,18 @@ func (a *App) GetUsersByIds(userIds []string, asAdmin bool, viewRestrictions *mo
|
||||
return a.sanitizeProfiles(result.Data.([]*model.User), asAdmin), nil
|
||||
}
|
||||
|
||||
func (a *App) GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[string][]*model.User, *model.AppError) {
|
||||
usersByChannelId, err := a.Srv.Store.User().GetProfileByGroupChannelIdsForUser(a.Session.UserId, channelIds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for channelId, userList := range usersByChannelId {
|
||||
usersByChannelId[channelId] = a.sanitizeProfiles(userList, asAdmin)
|
||||
}
|
||||
|
||||
return usersByChannelId, nil
|
||||
}
|
||||
|
||||
func (a *App) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
|
||||
result := <-a.Srv.Store.User().GetProfilesByUsernames(usernames, viewRestrictions)
|
||||
if result.Err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user