@using System.ComponentModel.DataAnnotations
@using ImageBoardServerApp.Data.Repository
@inject NavigationManager navigationManager
@code {
[Parameter]
[Required]
public ReportData report { get; set; }
private async Task banTarget(int days)
{
UserData user = report.UserReported;
user.TimeBanned = DateTimeOffset.Now.AddDays(days).ToUnixTimeMilliseconds();
await UsersRepository.updateUserAsync(user);
await removeReport();
}
private async Task banReporter(int days)
{
UserData user = report.UserReporter;
user.TimeBanned = DateTimeOffset.Now.AddDays(days).ToUnixTimeMilliseconds();
await UsersRepository.updateUserAsync(user);
await removeReport();
}
private async Task removeReport()
{
await ReportsRepository.deleteReportAsync(report.ReportID);
navigationManager.NavigateTo("/sys/reports", true, true);
}
}