Skip to content

Commit

Permalink
fix(feed): Unmarshal instead of Scan in handleExecuteReactPost in ind…
Browse files Browse the repository at this point in the history
…exer
  • Loading branch information
WaDadidou committed Nov 19, 2024
1 parent 97c83c0 commit f1bdc82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion go/internal/indexerhandler/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func (h *Handler) handleExecuteReactPost(_ *Message, execMsg *wasmtypes.MsgExecu
}

userReactions := make(map[string]interface{})
post.UserReactions.Scan(&userReactions)
if err := json.Unmarshal(post.UserReactions, &userReactions); err != nil {
h.logger.Error("failed to unmarshal UserReactions", zap.String("data", string(post.UserReactions)), zap.Error(err))
}

var users []networks.UserID
reactedUsers, found := userReactions[reactPost.Icon]
if found {
Expand Down
1 change: 0 additions & 1 deletion go/pkg/feed/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ func (s *FeedService) Posts(ctx context.Context, req *feedpb.PostsRequest) (*fee
continue
}

dbPost.UserReactions.Scan(&reactionsMap)
for icon, users := range reactionsMap {
ownState := false
if queryUserID != "" {
Expand Down

0 comments on commit f1bdc82

Please sign in to comment.