fix: ticket

This commit is contained in:
sajjadtalkhabi
2026-06-05 18:43:02 +03:30
parent 1c665830b0
commit ea562aeefa
53 changed files with 2475 additions and 859 deletions
+20 -15
View File
@@ -35,14 +35,12 @@ export const endpoints = {
getMissionaryDispatches: '/student/missionary/dispatches',
getMissionaryNarratives: '/student/missionary/narratives',
getStudentServices: '/student/services',
createStudentService: '/student/services',
getStudentServiceTypes: '/student/service-types',
getStudentServiceTitles: '/student/service-titles',
getStudentConsultants: '/student/consultants',
createStudentConsultant: '/student/consultants',
getStudentConsultantTitles: '/student/consultant-titles',
// Unified student tickets — handles services (type=service), consultants
// (type=advise) and inbox (type=ticket) via the same endpoint with a filter.
getStudentTickets: '/student/tickets',
createStudentTicket: '/student/tickets',
showStudentTicket: '/student/tickets/:id',
sendStudentTicketMessage: '/student/tickets/:id/messages',
getStudentCertificates: '/student/certificates',
downloadStudentCertificate: '/student/certificates/:id/download',
@@ -140,18 +138,25 @@ export const endpoints = {
showAssignmentSubmission: '/homework-submissions/:submissionId',
// ─── 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).
// Admin sees every type via /admin/tickets, filtered by ?type=:
// - messages page → ?type=ticket
// - services page → ?type=service
// - consultations page → ?type=advise
// Counselor is restricted to /counselor/tickets (advise-only at the backend).
getTicketsList: '/admin/tickets',
showTicket: '/admin/tickets/:id',
sendTicketMessage: '/admin/tickets/:id/messages',
changeTicketStatus: '/admin/tickets/:id/status',
getConsultationsList: '/counselor/tickets',
showConsultation: '/counselor/tickets/:id',
sendConsultationMessage: '/counselor/tickets/:id/messages',
changeConsultationStatus: '/counselor/tickets/:id/status',
getConsultationsList: '/admin/tickets',
showConsultation: '/admin/tickets/:id',
sendConsultationMessage: '/admin/tickets/:id/messages',
changeConsultationStatus: '/admin/tickets/:id/status',
getCounselorTickets: '/counselor/tickets',
showCounselorTicket: '/counselor/tickets/:id',
sendCounselorTicketMessage: '/counselor/tickets/:id/messages',
changeCounselorTicketStatus: '/counselor/tickets/:id/status',
}
export const buildUrl = (template, params = {}) =>