Migrate GetDeleted method from ChannelStore to return error interface (#14710)
* Migrate GetDeleted method from ChannelStore to return error interface * Moving i18n translations to the correct place Co-authored-by: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f2253df8a1
Коммит
9b0ae49b55
@@ -1589,7 +1589,18 @@ func (a *App) GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.A
|
||||
}
|
||||
|
||||
func (a *App) GetDeletedChannels(teamId string, offset int, limit int, userId string) (*model.ChannelList, *model.AppError) {
|
||||
return a.Srv().Store.Channel().GetDeleted(teamId, offset, limit, userId)
|
||||
list, err := a.Srv().Store.Channel().GetDeleted(teamId, offset, limit, userId)
|
||||
if err != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return nil, model.NewAppError("GetDeletedChannels", "app.channel.get_deleted.missing.app_error", nil, err.Error(), http.StatusNotFound)
|
||||
default:
|
||||
return nil, model.NewAppError("GetDeletedChannels", "app.channel.get_deleted.existing.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func (a *App) GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) {
|
||||
|
||||
Ссылка в новой задаче
Block a user