mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 修复题目搜索页面面包屑无法点击的问题
This commit is contained in:
1 parent
d662c55034
commit
2fe5d37c03
4 files changed
+6
-6
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.20.18",
|
"version": "2.20.19",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ export class ProblemMainHandler extends ProblemHandler {
|
|||||||
];
|
];
|
||||||
if (q) {
|
if (q) {
|
||||||
query.$text = { $search: q };
|
query.$text = { $search: q };
|
||||||
|
path[1][1] = 'problem_main';
|
||||||
path.push([q, null, null, true]);
|
path.push([q, null, null, true]);
|
||||||
}
|
}
|
||||||
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) query.hidden = false;
|
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) query.hidden = false;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
Pdoc, Ddoc, Drdoc, Tdoc, TrainingDoc, ProblemStatusDoc,
|
Pdoc, Ddoc, Drdoc, Tdoc, TrainingDoc, ProblemStatusDoc,
|
||||||
} from '../interface';
|
} from '../interface';
|
||||||
import { buildProjection } from '../utils';
|
import { buildProjection } from '../utils';
|
||||||
import { NumberKeys, ArrayKeys, Projection } from '../typeutils';
|
import { NumberKeys, ArrayKeys, Projection, MaybeArray } from '../typeutils';
|
||||||
import db from '../service/db';
|
import db from '../service/db';
|
||||||
import * as bus from '../service/bus';
|
import * as bus from '../service/bus';
|
||||||
import { Content } from '../loader';
|
import { Content } from '../loader';
|
||||||
@@ -202,7 +202,7 @@ export async function pull<K extends keyof DocType, T extends ArrayKeys<DocType[
|
|||||||
|
|
||||||
export async function deleteSub<T extends keyof DocType, K extends ArrayKeys<DocType[T]>>(
|
export async function deleteSub<T extends keyof DocType, K extends ArrayKeys<DocType[T]>>(
|
||||||
domainId: string, docType: T, docId: DocType[T]['docId'],
|
domainId: string, docType: T, docId: DocType[T]['docId'],
|
||||||
key: K, subId: DocType[T][K][0]['_id'] | DocType[T][K][0]['_id'][],
|
key: K, subId: MaybeArray<DocType[T][K][0]['_id']>,
|
||||||
): Promise<DocType[T]> {
|
): Promise<DocType[T]> {
|
||||||
subId = (subId instanceof Array) ? subId : [subId];
|
subId = (subId instanceof Array) ? subId : [subId];
|
||||||
const res = await coll.findOneAndUpdate(
|
const res = await coll.findOneAndUpdate(
|
||||||
@@ -235,9 +235,7 @@ export async function setSub<T extends keyof DocType, K extends ArrayKeys<DocTyp
|
|||||||
key: K, subId: DocType[T][K][0]['_id'], args: Partial<DocType[T][K][0]>,
|
key: K, subId: DocType[T][K][0]['_id'], args: Partial<DocType[T][K][0]>,
|
||||||
): Promise<DocType[T]> {
|
): Promise<DocType[T]> {
|
||||||
const $set = {};
|
const $set = {};
|
||||||
for (const k in args) {
|
for (const k in args) $set[`${key}.$.${k}`] = args[k];
|
||||||
$set[`${key}.$.${k}`] = args[k];
|
|
||||||
}
|
|
||||||
const res = await coll.findOneAndUpdate(
|
const res = await coll.findOneAndUpdate(
|
||||||
{
|
{
|
||||||
domainId,
|
domainId,
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ export type Value<O, V = ''> = {
|
|||||||
export type Projection<O> = (string & keyof O)[];
|
export type Projection<O> = (string & keyof O)[];
|
||||||
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||||
export type Filter<T, U> = T extends U ? T : never;
|
export type Filter<T, U> = T extends U ? T : never;
|
||||||
|
export type MaybeArray<T> = T | T[];
|
||||||
Reference in new issue
Block a user