[backend/api-shared] Fix emoji reactions not being rendered consistently

This commit is contained in:
Laura Hausmann 2024-05-14 16:34:18 +02:00
parent 39296bbc25
commit 839f93ff66
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 2 additions and 2 deletions

View file

@ -283,7 +283,7 @@ public class NoteRenderer(
var counts = notes.ToDictionary(p => p.Id, p => p.Reactions); var counts = notes.ToDictionary(p => p.Id, p => p.Reactions);
var res = await db.NoteReactions var res = await db.NoteReactions
.Where(p => notes.Contains(p.Note)) .Where(p => notes.Contains(p.Note))
.GroupBy(p => p.Reaction) .GroupBy(p => new { p.NoteId, p.Reaction })
.Select(p => new ReactionEntity .Select(p => new ReactionEntity
{ {
NoteId = p.First().NoteId, NoteId = p.First().NoteId,

View file

@ -115,7 +115,7 @@ public class NoteRenderer(UserRenderer userRenderer, DatabaseContext db, EmojiSe
var counts = notes.ToDictionary(p => p.Id, p => p.Reactions); var counts = notes.ToDictionary(p => p.Id, p => p.Reactions);
var res = await db.NoteReactions var res = await db.NoteReactions
.Where(p => notes.Contains(p.Note)) .Where(p => notes.Contains(p.Note))
.GroupBy(p => p.Reaction) .GroupBy(p => new { p.NoteId, p.Reaction })
.Select(p => new NoteReactionSchema .Select(p => new NoteReactionSchema
{ {
NoteId = p.First().NoteId, NoteId = p.First().NoteId,