修复题目列表分页异常

This commit is contained in:
masnn committed 2020-05-17 20:20:07 +08:00
1 parent 9e5d3dea89
commit cbcf9ebbc2
5 files changed
+118 -35

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ class ProblemHandler extends Handler {
let psdict = {};
if (category) q.category = category;
if (!this.user.hasPerm(PERM_VIEW_PROBLEM_HIDDEN)) q.hidden = false;
const [pdocs, pcount] = await paginate(
const [pdocs, ppcount, pcount] = await paginate(
problem.getMulti(q).sort({ pid: 1 }),
page,
await system.get('PROBLEM_PER_PAGE'),
@@ -47,7 +47,7 @@ class ProblemHandler extends Handler {
['problem_main', null],
];
this.response.body = {
path, page, pcount, pdocs, psdict, category,
path, page, pcount, ppcount, pdocs, psdict, category,
};
}
}
+3 -1
View File
@@ -1,3 +1,5 @@
const { ObjectID } = require('bson');
exports.udoc = {
_id: 0,
mail: '',
@@ -44,7 +46,7 @@ export interface TestCase {
export interface Rdoc {
_id: ObjectID,
pid: ObjectID,
owner: number,
uid: number,
lang: string,
code: string,
score: number,
+1 -1
View File
@@ -42,7 +42,7 @@ export interface TestCase {
export interface Rdoc {
_id: ObjectID,
pid: ObjectID,
owner: number,
uid: number,
lang: string,
code: string,
score: number,