mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: training: fix enroll
This commit is contained in:
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user