[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
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2020-09-16 11:04:17 +03:00
коммит произвёл GitHub
родитель 9c272f0b20
Коммит e69a2a41ca
14 изменённых файлов: 229 добавлений и 77 удалений

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

@@ -732,13 +732,13 @@ func (_m *UserStore) GetProfilesByUsernames(usernames []string, viewRestrictions
return r0, r1
}
// GetProfilesInChannel provides a mock function with given fields: channelId, offset, limit
func (_m *UserStore) GetProfilesInChannel(channelId string, offset int, limit int) ([]*model.User, *model.AppError) {
ret := _m.Called(channelId, offset, limit)
// GetProfilesInChannel provides a mock function with given fields: options
func (_m *UserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
ret := _m.Called(options)
var r0 []*model.User
if rf, ok := ret.Get(0).(func(string, int, int) []*model.User); ok {
r0 = rf(channelId, offset, limit)
if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok {
r0 = rf(options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.User)
@@ -746,8 +746,8 @@ func (_m *UserStore) GetProfilesInChannel(channelId string, offset int, limit in
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
r1 = rf(channelId, offset, limit)
if rf, ok := ret.Get(1).(func(*model.UserGetOptions) *model.AppError); ok {
r1 = rf(options)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
@@ -757,13 +757,13 @@ func (_m *UserStore) GetProfilesInChannel(channelId string, offset int, limit in
return r0, r1
}
// GetProfilesInChannelByStatus provides a mock function with given fields: channelId, offset, limit
func (_m *UserStore) GetProfilesInChannelByStatus(channelId string, offset int, limit int) ([]*model.User, *model.AppError) {
ret := _m.Called(channelId, offset, limit)
// GetProfilesInChannelByStatus provides a mock function with given fields: options
func (_m *UserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
ret := _m.Called(options)
var r0 []*model.User
if rf, ok := ret.Get(0).(func(string, int, int) []*model.User); ok {
r0 = rf(channelId, offset, limit)
if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok {
r0 = rf(options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.User)
@@ -771,8 +771,8 @@ func (_m *UserStore) GetProfilesInChannelByStatus(channelId string, offset int,
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
r1 = rf(channelId, offset, limit)
if rf, ok := ret.Get(1).(func(*model.UserGetOptions) *model.AppError); ok {
r1 = rf(options)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)