This commit is contained in:
parent
05ad5a4856
commit
083fd6832e
1 changed files with 3 additions and 3 deletions
|
@ -88,18 +88,18 @@ public class AdminController(
|
||||||
[HttpPatch("/api/v1/pleroma/admin/reports")]
|
[HttpPatch("/api/v1/pleroma/admin/reports")]
|
||||||
[Authenticate("admin:read:reports")]
|
[Authenticate("admin:read:reports")]
|
||||||
[ProducesResults(HttpStatusCode.OK)]
|
[ProducesResults(HttpStatusCode.OK)]
|
||||||
public async void SetReportState(ReportsQuery query)
|
public void SetReportState(ReportsQuery query)
|
||||||
{
|
{
|
||||||
var user = HttpContext.GetUserOrFail();
|
var user = HttpContext.GetUserOrFail();
|
||||||
|
|
||||||
foreach (var list in query.Reports)
|
foreach (var list in query.Reports)
|
||||||
{
|
{
|
||||||
var report = await db.Reports.Where(p => p.Id == list.Id).FirstOrDefaultAsync()
|
var report = db.Reports.FirstOrDefault(p => p.Id == list.Id)
|
||||||
?? throw GracefulException.NotFound("Report not found");
|
?? throw GracefulException.NotFound("Report not found");
|
||||||
|
|
||||||
report.Resolved = list.State == "closed";
|
report.Resolved = list.State == "closed";
|
||||||
|
|
||||||
await db.SaveChangesAsync();
|
db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue