[backend/api] Set report assignee when marking report as resolved (ISH-116)

This commit is contained in:
Laura Hausmann 2025-03-11 20:42:30 +01:00
parent f3999f80be
commit b7446eceeb
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -108,9 +108,11 @@ public class ModerationController(
[ProducesErrors(HttpStatusCode.NotFound)]
public async Task ResolveReport(string id)
{
var user = HttpContext.GetUserOrFail();
var report = await db.Reports.FirstOrDefaultAsync(p => p.Id == id)
?? throw GracefulException.NotFound("Report not found");
report.Assignee = user;
report.Resolved = true;
await db.SaveChangesAsync();
}