NOTE: temp commit, started rolling back changes to auth system
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
e2ce6cbf37
commit
ce201207d4
13 changed files with 97 additions and 63 deletions
|
@ -23,7 +23,7 @@
|
|||
<br/>
|
||||
<span>Explain further (optional)</span>
|
||||
<div class="pd centered marg">
|
||||
<RadzenTextArea Placeholder="Specify..." @bind-Value="@explaination" Cols="30" Rows="6" Class="w-100"/>
|
||||
<RadzenTextArea Placeholder="Specify..." @bind-Value="@explaination" Cols="30" Rows="6" Class="w-100"/>
|
||||
</div>
|
||||
<RadzenButton class="pd" Click="@onReportClick" Text="Report"></RadzenButton>
|
||||
</Authorized>
|
||||
|
@ -41,11 +41,11 @@
|
|||
[Parameter]
|
||||
[Required]
|
||||
public string type { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
[Required]
|
||||
public string board { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
[Required]
|
||||
public string id { get; set; }
|
||||
|
@ -58,12 +58,12 @@
|
|||
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
||||
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
||||
var usr = user.User;
|
||||
UserData foundusr = await UsersRepository.getUserByIdAsync(int.Parse(usr.Identity.Name));
|
||||
UserData foundusr = await UsersRepository.getUserByEmailRawAsync(usr.Identity.Name);
|
||||
if (foundusr == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (foundusr.TimeBanned != -1)
|
||||
{
|
||||
return;
|
||||
|
@ -94,7 +94,7 @@
|
|||
};
|
||||
|
||||
List<ReportData> submittedReports = foundusr.RecivedReports;
|
||||
foreach(var r in submittedReports)
|
||||
foreach (var r in submittedReports)
|
||||
{
|
||||
if (r.ReportedPostID == reportData.ReportedPostID && r.ReportedCommentID == reportData.ReportedCommentID)
|
||||
return;
|
||||
|
@ -103,4 +103,5 @@
|
|||
await ReportsRepository.createReportAsync(reportData);
|
||||
js.InvokeVoidAsync("window.close");
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue