🎨 Adjust post shuffle query
This commit is contained in:
@@ -106,10 +106,9 @@ public class PostController(
|
||||
var totalCount = await query
|
||||
.CountAsync();
|
||||
|
||||
if (shuffle)
|
||||
query = query.OrderBy(e => EF.Functions.Random());
|
||||
else
|
||||
query = query.OrderByDescending(e => e.PublishedAt ?? e.CreatedAt);
|
||||
query = shuffle
|
||||
? query.OrderBy(e => EF.Functions.Random())
|
||||
: query.OrderByDescending(e => e.PublishedAt ?? e.CreatedAt);
|
||||
|
||||
var posts = await query
|
||||
.Include(e => e.RepliedPost)
|
||||
|
Reference in New Issue
Block a user