mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: session pagination
This commit is contained in:
1 parent
bc0055781e
commit
19cd10ab7b
2 files changed
+2
-2
No files matched your search
@@ -3,7 +3,7 @@ import { sessionCount, sessionList, sessionDetail } from '../models/sessions.js'
|
||||
|
||||
export async function sessionListController(req, res) {
|
||||
const { nextKey } = req.query
|
||||
const itemsPerPage = 10
|
||||
const itemsPerPage = 50
|
||||
|
||||
try {
|
||||
// const totalSessions = await sessionCount()
|
||||
|
||||
@@ -35,7 +35,7 @@ export async function sessionList({ nextKey, itemsPerPage, order }) {
|
||||
let matchStage = {}
|
||||
if (nextKey) {
|
||||
const key = new mongoose.Types.ObjectId(nextKey)
|
||||
matchStage = { user: order.matchStage(key) }
|
||||
matchStage = { _id: order.matchStage(key) }
|
||||
}
|
||||
const sessions = await Session.aggregate([
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user