core: 修复nAccept计算异常的问题

This commit is contained in:
undefined committed 2021-02-22 00:01:33 +08:00
1 parent 4652ce86ab
commit 3f78c35359
4 files changed
+8 -17

No files matched your search

+1 -1
View File
@@ -306,7 +306,7 @@ export async function setIfNotStatus<T extends keyof DocStatusType, K extends ke
key: K, value: DocStatusType[T][K], ifNot: DocStatusType[T][K], args: Partial<DocStatusType[T]>,
): Promise<DocStatusType[T]> {
const current = await collStatus.findOne({ domainId, docType, docId, uid }) || {};
if (current[key] === ifNot) return current;
if (current[key] === ifNot) return null;
const res = await collStatus.findOneAndUpdate(
{ domainId, docType, docId, uid },
{ $set: { [key]: value, ...args } },