core: 删除题目前检查是否已被比赛使用

This commit is contained in:
undefined committed 2021-05-20 22:55:47 +08:00
1 parent e4c6cf258d
commit 26ded9d5df
9 files changed
+78 -62

No files matched your search

+5
View File
@@ -444,6 +444,10 @@ export async function get(domainId: string, tid: ObjectID, type: Type | -1 = doc
return tdoc;
}
export async function getRelated(domainId: string, pid: number, type: Type = document.TYPE_CONTEST) {
return await document.getMulti(domainId, type, { pids: pid }).toArray();
}
export async function updateStatus(
domainId: string, tid: ObjectID, uid: number, rid: ObjectID, pid: number,
accept = false, score = 0, type: 30 | 60 = document.TYPE_CONTEST,
@@ -624,6 +628,7 @@ global.Hydro.model.contest = {
edit,
del,
get,
getRelated,
updateStatus,
getStatus,
count,