mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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) {
|
export async function enroll(domainId: string, tid: ObjectId, uid: number) {
|
||||||
try {
|
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) {
|
} catch (e) {
|
||||||
throw new TrainingAlreadyEnrollError(tid, uid);
|
throw new TrainingAlreadyEnrollError(tid, uid);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user