Migrate Delete/Restore/SetDeleteAt methods from ChannelStore to return error interface (#14700)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-06-05 07:32:16 -04:00
коммит произвёл GitHub
родитель 18ddae2c1b
Коммит ac32b2da41
10 изменённых файлов: 74 добавлений и 88 удалений

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

@@ -643,7 +643,7 @@ func (a *App) RestoreChannel(channel *model.Channel, userId string) (*model.Chan
}
if err := a.Srv().Store.Channel().Restore(channel.Id, model.GetMillis()); err != nil {
return nil, err
return nil, model.NewAppError("RestoreChannel", "app.channel.restore.app_error", nil, err.Error(), http.StatusInternalServerError)
}
channel.DeleteAt = 0
a.invalidateCacheForChannel(channel)
@@ -1197,7 +1197,7 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr
deleteAt := model.GetMillis()
if err := a.Srv().Store.Channel().Delete(channel.Id, deleteAt); err != nil {
return err
return model.NewAppError("DeleteChannel", "app.channel.delete.app_error", nil, err.Error(), http.StatusInternalServerError)
}
a.invalidateCacheForChannel(channel)