fix: admin courses

This commit is contained in:
sajjadtalkhabi
2026-05-27 14:47:19 +03:30
parent 7eb2984f5e
commit cb86920015
50 changed files with 787 additions and 649 deletions
+19 -10
View File
@@ -1,18 +1,22 @@
export const endpoints = {
// ─── Auth & profile ────────────────────────────────────────────────────────
register: '/register',
// Backend-aligned (Postman: Auth collection)
register: '/auth/register',
login: '/auth/login',
logout: '/auth/logout',
me: '/auth/me',
updateProfile: '/me',
registerData: '/me/register-data',
// FE-only — NOT in backend Postman doc; kept so existing UI/mock layer works.
resendVerificationCodeForRegister: '/resend-verification-code',
verifyCode: '/verify-code',
completeProfile: '/complete-profile',
getRegistrationQuestionVideo: '/verification-registration-media',
login: '/login',
loginWithCode2Step: '/login-with-code',
forgotPassword: '/forgot-password',
verifyForgotPasswordCode: '/verify-forgot-password-code',
resetPassword: '/reset-password',
logout: '/logout',
me: '/auth/me',
updateProfile: '/profile',
// ─── Geo ───────────────────────────────────────────────────────────────────
provinceList: '/provinces',
@@ -67,6 +71,7 @@ export const endpoints = {
showTerm: '/terms/:id',
updateTerm: '/terms/:id',
deleteTerm: '/terms/:id',
getTermAttendees: '/terms/:termId/attendees',
// ─── Backend-aligned: Courses ──────────────────────────────────────────────
getCoursesList: '/courses',
@@ -74,6 +79,7 @@ export const endpoints = {
showCourse: '/courses/:id',
updateCourse: '/courses/:id',
deleteCourse: '/courses/:id',
getCourseAttendees: '/courses/:courseId/attendees',
// ─── Backend-aligned: Sessions ─────────────────────────────────────────────
getSessionsList: '/sessions',
@@ -146,16 +152,19 @@ export const endpoints = {
getAssignmentSubmissions: '/homeworks/:homeworkId/submissions',
showAssignmentSubmission: '/homework-submissions/:submissionId',
// ─── Tickets / Consultations (out of scope of Terms/Courses backend doc) ───
// ─── Backend-aligned: Tickets ─────────────────────────────────────────────
// Admin "messages" UI talks to /admin/tickets.
// Admin "consultations" UI talks to /counselor/tickets (same schema; the
// counselor scope is the consultation pool).
getTicketsList: '/admin/tickets',
showTicket: '/admin/tickets/:id',
sendTicketMessage: '/admin/tickets/:id/messages',
changeTicketStatus: '/admin/tickets/:id/status',
getConsultationsList: '/admin/consultations',
showConsultation: '/admin/consultations/:id',
sendConsultationMessage: '/admin/consultations/:id/messages',
changeConsultationStatus: '/admin/consultations/:id/status',
getConsultationsList: '/counselor/tickets',
showConsultation: '/counselor/tickets/:id',
sendConsultationMessage: '/counselor/tickets/:id/messages',
changeConsultationStatus: '/counselor/tickets/:id/status',
}
export const buildUrl = (template, params = {}) =>