@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.ToUnixTimeMilliseconds() + (days * 3600000);
user.BanReason = report.ReportReason;
await UsersRepository.updateUserAsync(user);
await removeReport();
}
private async Task banReporter(int days)
{
UserData user = report.UserReporter;
user.TimeBanned = DateTimeOffset.Now.ToUnixTimeMilliseconds() + (days * 3600000);
user.BanReason = "misuse of the report system";
await UsersRepository.updateUserAsync(user);
await removeReport();
}
private async Task removeReport()
{
await ReportsRepository.deleteReportAsync(report.ReportID);
navigationManager.NavigateTo("/sys/click/red/_sys_modmenu_reports", true, true);
}
}