mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-10 22:08:39 +00:00
Fix client side query in BannedPage
This commit is contained in:
parent
b0a57f05f9
commit
de228cb242
1 changed files with 5 additions and 4 deletions
|
@ -24,10 +24,11 @@ public class BannedUserPage : BaseLayout
|
|||
if (user == null) return this.Redirect("~/login");
|
||||
if (!user.IsBanned) return this.Redirect("~/");
|
||||
|
||||
ModerationCaseEntity? modCase = await this.Database.Cases
|
||||
.LastOrDefaultAsync(c => c.AffectedId == user.UserId
|
||||
&& c.Type == CaseType.UserBan
|
||||
&& !c.Dismissed);
|
||||
ModerationCaseEntity? modCase = await this.Database.Cases.OrderByDescending(c => c.CreatedAt)
|
||||
.Where(c => c.AffectedId == user.UserId)
|
||||
.Where(c => c.Type == CaseType.UserBan)
|
||||
.Where(c => c.DismissedAt != null)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
if (modCase == null) return this.Redirect("~/");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue