Fix client side query in BannedPage

This commit is contained in:
Slendy 2023-05-31 15:12:40 -05:00
commit de228cb242
No known key found for this signature in database
GPG key ID: 7288D68361B91428

View file

@ -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("~/");