diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index afaa39db6..e0aea115c 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -963,10 +963,10 @@ export function getClarification(domainId: string, did: ObjectId) { return document.get(domainId, document.TYPE_CONTEST_CLARIFICATION, did); } -export function getMultiClarification(domainId: string, tid: ObjectId, owner = 0) { +export function getMultiClarification(domainId: string, tid: ObjectId, owner?: number) { return document.getMulti( domainId, document.TYPE_CONTEST_CLARIFICATION, - { parentType: document.TYPE_CONTEST, parentId: tid, ...(owner ? { owner: { $in: [owner, 0] } } : {}) }, + { parentType: document.TYPE_CONTEST, parentId: tid, ...(typeof owner === 'number' ? { owner: { $in: [owner, 0] } } : {}) }, ).sort('_id', -1).toArray(); }