core: training: fix enroll

This commit is contained in:
undefined committed 2024-08-07 11:37:19 +08:00
1 parent f7e31ff624
commit 913de363a5
1 file changed
+1 -1
+1 -1
View File
@@ -23,7 +23,7 @@ export async function getListStatus(domainId: string, uid: number, tids: ObjectI
export async function enroll(domainId: string, tid: ObjectId, uid: number) {
try {
await document.setStatus(domainId, document.TYPE_TRAINING, tid, uid, { enroll: 1 });
await document.setIfNotStatus(domainId, document.TYPE_TRAINING, tid, uid, 'enroll', 1, 1, {});
} catch (e) {
throw new TrainingAlreadyEnrollError(tid, uid);
}