Unverified Commit c76ffb0f authored by Neo's avatar Neo Committed by GitHub

chore: adds a check to only query reactions when there are actual memos (#4984)

parent 1dd25634
......@@ -186,6 +186,7 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
memoNames = append(memoNames, fmt.Sprintf("'%s/%s'", MemoNamePrefix, m.UID))
}
if len(memoNames) > 0 {
reactions, err := s.Store.ListReactions(ctx, &store.FindReaction{
Filters: []string{fmt.Sprintf("content_id in [%s]", strings.Join(memoNames, ", "))},
})
......@@ -196,6 +197,7 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
for _, reaction := range reactions {
reactionMap[reaction.ContentID] = append(reactionMap[reaction.ContentID], reaction)
}
}
for _, memo := range memos {
name := fmt.Sprintf("'%s/%s'", MemoNamePrefix, memo.UID)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment