Migrate Reactions store to Sync by default (#10737)

* Migrate Reactions store to Sync by default

* Fixing tests

* Fixing tests

* Fixing govet

* fixing tests

* Addressing PR review comments
Этот коммит содержится в:
Jesús Espino
2019-04-30 21:34:26 +02:00
коммит произвёл Christopher Speller
родитель 584ec68755
Коммит 9a9d5d4081
16 изменённых файлов: 408 добавлений и 301 удалений

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

@@ -407,15 +407,14 @@ func (a *App) buildPostReplies(postId string) (*[]ReplyImportData, *model.AppErr
func (a *App) BuildPostReactions(postId string) (*[]ReactionImportData, *model.AppError) {
var reactionsOfPost []ReactionImportData
result := <-a.Srv.Store.Reaction().GetForPost(postId, true)
if result.Err != nil {
return nil, result.Err
reactions, err := a.Srv.Store.Reaction().GetForPost(postId, true)
if err != nil {
return nil, err
}
reactions := result.Data.([]*model.Reaction)
for _, reaction := range reactions {
user, err := a.Srv.Store.User().Get(reaction.UserId)
var user *model.User
user, err = a.Srv.Store.User().Get(reaction.UserId)
if err != nil {
return nil, err
}