Order users list by status then by user id desc

This commit is contained in:
jvyden 2022-01-22 21:40:00 -05:00
parent e4cf339394
commit 75ad64db40
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -8,7 +8,6 @@ using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
@ -36,9 +35,11 @@ public class UsersPage : BaseLayout
this.Users = await this.Database.Users.Where
(u => !u.Banned)
.OrderByDescending(b => b.UserId)
.Skip(pageNumber * ServerStatics.PageSize)
.Take(ServerStatics.PageSize)
.ToAsyncEnumerable()
.OrderBy(u => u.Status)
.ThenByDescending(u => u.UserId)
.ToListAsync();
return this.Page();