[backend/api] Check reaction name with and without colons

This commit is contained in:
pancakes 2025-03-08 01:27:05 +10:00 committed by Laura Hausmann
parent 091d0e0c3f
commit f639124881
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -158,8 +158,10 @@ public class NoteController(
.FirstOrDefaultAsync() ??
throw GracefulException.NotFound("Note not found");
name = name.Trim(':');
var users = await db.NoteReactions
.Where(p => p.Note == note && p.Reaction == name)
.Where(p => p.Note == note && (p.Reaction == $":{name}:" || p.Reaction == name))
.Include(p => p.User.UserProfile)
.Select(p => p.User)
.ToListAsync();