core: fix contest clarification display (#756)

This commit is contained in:
panda authored and GitHub committed 2024-03-17 06:55:55 +08:00
1 parent b320f78646
commit ae7563841f
1 file changed
+2 -2
+2 -2
View File
@@ -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();
}