fix: user changes

This commit is contained in:
sajjadtalkhabi
2026-05-28 13:34:30 +03:30
parent cb86920015
commit 7ed6ec9ae1
46 changed files with 328 additions and 1114 deletions
+8 -21
View File
@@ -23,16 +23,12 @@ export const endpoints = {
citiesList: '/provinces/:provinceId/cities',
// ─── Student-facing ────────────────────────────────────────────────────────
getStudentCourses: '/student/courses',
showStudentCourse: '/student/courses/:id',
getStudentTerms: '/student/terms',
showStudentTerm: '/student/terms/:id',
showStudentLesson: '/student/lessons/:id',
showStudentSession: '/student/sessions/:id',
submitStudentSessionHomework: '/student/sessions/:id/homework',
showStudentExam: '/student/exams/:id',
startStudentExamAttempt: '/student/exams/:id/attempts',
submitStudentExamAttempt: '/student/exams/:id/submit',
// Courses, sessions, exams use the shared backend-aligned endpoints below
// (/courses, /sessions/:id, /exams/:id, /exams/:id/submit) — the backend
// infers role from the auth token and scopes the response. Terms have a
// dedicated student route (returns the membership row with the nested term).
getStudentTerms: '/student/my-terms',
showStudentTerm: '/student/my-terms/:id',
getMissionaryProfile: '/student/missionary/profile',
getMissionaryRequests: '/student/missionary/requests',
@@ -71,7 +67,7 @@ export const endpoints = {
showTerm: '/terms/:id',
updateTerm: '/terms/:id',
deleteTerm: '/terms/:id',
getTermAttendees: '/terms/:termId/attendees',
getTermEnrollees: '/admin/terms/:termId/enrollees',
// ─── Backend-aligned: Courses ──────────────────────────────────────────────
getCoursesList: '/courses',
@@ -79,7 +75,6 @@ export const endpoints = {
showCourse: '/courses/:id',
updateCourse: '/courses/:id',
deleteCourse: '/courses/:id',
getCourseAttendees: '/courses/:courseId/attendees',
// ─── Backend-aligned: Sessions ─────────────────────────────────────────────
getSessionsList: '/sessions',
@@ -120,21 +115,13 @@ export const endpoints = {
// Terms — clone + status + students-in-term + courses-in-term
cloneTerm: '/admin/terms/:id/clone',
listUserTerm: '/admin/terms/:termId/students',
addUserTerm: '/admin/terms/:termId/students',
addUserTerm: '/admin/terms/:termId/enrollees',
removeUserTerm: '/admin/terms/:termId/students/:userId',
changeLeaveStatus: '/admin/terms/:termId/students/:userId/toggle-leave',
listCourseTerm: '/admin/terms/:termId/courses',
addCourseTerm: '/admin/terms/:termId/courses',
removeCourseTerm: '/admin/terms/:termId/courses/:courseId',
// Courses — students-in-course + attach/detach sessions (backend uses 1:N via session.course_id)
listCourseStudents: '/admin/courses/:courseId/students',
addCourseStudent: '/admin/courses/:courseId/students',
removeCourseStudent: '/admin/courses/:courseId/students/:userId',
listCourseSessions: '/admin/courses/:courseId/sessions',
attachCourseSession: '/admin/courses/:courseId/sessions',
detachCourseSession: '/admin/courses/:courseId/sessions/:sessionId',
// Sessions — attendance roster
getSessionsAttendance: '/admin/sessions/:sessionId/attendances',