mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: add order to pagination
This commit is contained in:
1 parent
68db16419d
commit
fa36b63fbe
8 files changed
+85
-50
No files matched your search
@@ -32,7 +32,7 @@ function formatTime(time) {
|
||||
|
||||
export async function sessionList(pagination) {
|
||||
const sessions = await Session.aggregate([
|
||||
pagination.matchStage('_id'),
|
||||
pagination.match('_id'),
|
||||
{
|
||||
$lookup: {
|
||||
from: 'users',
|
||||
@@ -50,7 +50,7 @@ export async function sessionList(pagination) {
|
||||
as: 'commands',
|
||||
},
|
||||
},
|
||||
pagination.order('_id'),
|
||||
pagination.sort('_id'),
|
||||
pagination.limit(),
|
||||
])
|
||||
|
||||
|
||||
Reference in new issue
Block a user