public async Task <IActionResult> ReportUser([FromBody] FeedReport report, CancellationToken ct = default) { if (!AuthenticationUtilities.IsAllowedFeed(User)) { return(BadRequest("User has been banned from Feed")); } await _feedService.ReportPostAsync(report, ct); return(Ok()); }
public async Task MarkReportAsDeletedAsync(int reportId, CancellationToken ct = default) { FeedReport report = await _context.FeedReports.FindAsync(reportId); if (report != null) { report.IsDeleted = true; _context.Update(report); await _context.SaveChangesAsync(); } }
public async Task ReportPostAsync(FeedReport report, CancellationToken ct = default) { await _context.FeedReports.AddAsync(report); await _context.SaveChangesAsync(ct); }