core: 支持搜索题号

This commit is contained in:
undefined committed 2021-06-23 17:32:06 +08:00
1 parent cd3c74649c
commit cc58aa667e
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.28.49",
"version": "2.28.50",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+2 -2
View File
@@ -98,8 +98,8 @@ export class ProblemMainHandler extends ProblemHandler {
system.get('pagination.problem'),
);
if (sort) pdocs = pdocs.sort((a, b) => sort.indexOf(a.docId) - sort.indexOf(b.docId));
if (q && +q) {
const pdoc = await problem.get(domainId, +q, problem.PROJECTION_LIST);
if (q) {
const pdoc = await problem.get(domainId, +q || q, problem.PROJECTION_LIST);
if (pdoc) pdocs.filter((doc) => doc.docId !== pdoc.docId).unshift(pdoc);
}
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {