Migrate GetChannels method from ChannelStore to return error interface (#14711)
* Migrate GetChannels method from ChannelStore to return error interface * Fix testing * Changed error type: ErrInvalidInput -> ErrNotFound * Added note about error migrations * Fix en.json * Fix i18n Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9b0ae49b55
Коммит
41d9c673cf
@@ -560,7 +560,7 @@ func (_m *ChannelStore) GetChannelUnread(channelId string, userId string) (*mode
|
||||
}
|
||||
|
||||
// GetChannels provides a mock function with given fields: teamId, userId, includeDeleted
|
||||
func (_m *ChannelStore) GetChannels(teamId string, userId string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) GetChannels(teamId string, userId string, includeDeleted bool) (*model.ChannelList, error) {
|
||||
ret := _m.Called(teamId, userId, includeDeleted)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -572,13 +572,11 @@ func (_m *ChannelStore) GetChannels(teamId string, userId string, includeDeleted
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(teamId, userId, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
|
||||
Ссылка в новой задаче
Block a user