extended admin tool for finished lessons
All checks were successful
Deploy to production / deploy (push) Successful in 2m54s
All checks were successful
Deploy to production / deploy (push) Successful in 2m54s
This commit is contained in:
@@ -1974,6 +1974,28 @@ class AdminService {
|
||||
}
|
||||
}
|
||||
|
||||
async adminMarkUserVocabLessonsCompleteThrough(requesterHashedId, targetHashedId, courseId, throughLessonNumber) {
|
||||
if (!(await this.hasUserAccess(requesterHashedId, 'useradministration'))) {
|
||||
throw new Error('noaccess');
|
||||
}
|
||||
const vocab = new VocabService();
|
||||
try {
|
||||
return await vocab.adminMarkLessonsCompleteThrough(
|
||||
targetHashedId,
|
||||
Number(courseId),
|
||||
Number(throughLessonNumber)
|
||||
);
|
||||
} catch (e) {
|
||||
if (e.status === 403) {
|
||||
throw new Error('notenrolled');
|
||||
}
|
||||
if (e.status === 400) {
|
||||
throw new Error('badrequest');
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
async adminListUserEnrolledVocabCourses(requesterHashedId, targetHashedId) {
|
||||
if (!(await this.hasUserAccess(requesterHashedId, 'useradministration'))) {
|
||||
throw new Error('noaccess');
|
||||
|
||||
Reference in New Issue
Block a user