Return empty list of channels when requesting more channels at the end of cursor (#21557)

Этот коммит содержится в:
Zubair Ahmed
2022-11-02 15:10:51 +05:30
коммит произвёл GitHub
родитель b93a013934
Коммит 79e4959d02
4 изменённых файлов: 18 добавлений и 13 удалений

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

@@ -1876,15 +1876,8 @@ func (a *App) GetChannelsForTeamForUser(c request.CTX, teamID string, userID str
func (a *App) GetChannelsForTeamForUserWithCursor(c request.CTX, teamID string, userID string, opts *model.ChannelSearchOpts, afterChannelID string) (model.ChannelList, *model.AppError) {
list, err := a.Srv().Store().Channel().GetChannelsWithCursor(teamID, userID, opts, afterChannelID)
if err != nil {
var nfErr *store.ErrNotFound
switch {
case errors.As(err, &nfErr):
return nil, model.NewAppError("GetChannelsForUser", "app.channel.get_channels.not_found.app_error", nil, "", http.StatusNotFound).Wrap(err)
default:
return nil, model.NewAppError("GetChannelsForUser", "app.channel.get_channels.get.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return nil, model.NewAppError("GetChannelsForUser", "app.channel.get_channels.get.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return list, nil
}