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());
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        public async Task ReportPostAsync(FeedReport report, CancellationToken ct = default)
        {
            await _context.FeedReports.AddAsync(report);

            await _context.SaveChangesAsync(ct);
        }