extended admin tool for finished lessons
All checks were successful
Deploy to production / deploy (push) Successful in 2m54s

This commit is contained in:
Torsten Schulz (local)
2026-04-02 13:32:13 +02:00
parent 9d663e4f2b
commit edbf22ac5b
9 changed files with 281 additions and 0 deletions

View File

@@ -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');