Migration of ChannelStore.GetMoreChannels to return plain error (#14811)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-06-19 14:26:35 -04:00
коммит произвёл GitHub
родитель 4a974eabea
Коммит d391fd6231
8 изменённых файлов: 20 добавлений и 18 удалений

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

@@ -614,8 +614,8 @@ func testChannelStoreDelete(t *testing.T, ss store.Store) {
require.Nil(t, nErr)
require.Len(t, *list, 1, "invalid number of channels")
list, err = ss.Channel().GetMoreChannels(o1.TeamId, m1.UserId, 0, 100)
require.Nil(t, err)
list, nErr = ss.Channel().GetMoreChannels(o1.TeamId, m1.UserId, 0, 100)
require.Nil(t, nErr)
require.Len(t, *list, 1, "invalid number of channels")
cresult := ss.Channel().PermanentDelete(o2.Id)

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

@@ -981,7 +981,7 @@ func (_m *ChannelStore) GetMembersForUserWithPagination(teamId string, userId st
}
// GetMoreChannels provides a mock function with given fields: teamId, userId, offset, limit
func (_m *ChannelStore) GetMoreChannels(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) {
func (_m *ChannelStore) GetMoreChannels(teamId string, userId string, offset int, limit int) (*model.ChannelList, error) {
ret := _m.Called(teamId, userId, offset, limit)
var r0 *model.ChannelList
@@ -993,13 +993,11 @@ func (_m *ChannelStore) GetMoreChannels(teamId string, userId string, offset int
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
var r1 error
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
r1 = rf(teamId, userId, offset, limit)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
r1 = ret.Error(1)
}
return r0, r1