feat(services): add Service Types management UI
Admin CRUD page for service types, plus wiring the student "request service" form's category select to the real list instead of a hardcoded pair of options.
This commit is contained in:
@@ -55,6 +55,14 @@ export const endpoints = {
|
||||
getStudentCertificates: '/student/certificates',
|
||||
downloadStudentCertificate: '/student/certificates/:id/download',
|
||||
|
||||
// ─── Backend-aligned: Service types (settings) ────────────────────────────
|
||||
// Read is open to any authenticated role (populates the student "request
|
||||
// service" category select); create/update/delete are admin-only.
|
||||
getServiceTypesList: '/service-types',
|
||||
addServiceType: '/service-types',
|
||||
updateServiceType: '/service-types/:id',
|
||||
deleteServiceType: '/service-types/:id',
|
||||
|
||||
// ─── Per-role aggregated dashboards ────────────────────────────────────────
|
||||
// Each requires the matching role's token; backend scopes the payload.
|
||||
getAdminDashboard: '/admin/dashboard',
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { http } from '@/services/api/http'
|
||||
import { buildUrl, endpoints } from '@/services/api/endpoints'
|
||||
|
||||
export const apiGetServiceTypes = () => http.get(endpoints.getServiceTypesList)
|
||||
|
||||
export const apiAddServiceType = (payload) => http.post(endpoints.addServiceType, payload)
|
||||
|
||||
export const apiUpdateServiceType = (id, payload) =>
|
||||
http.patch(buildUrl(endpoints.updateServiceType, { id }), payload)
|
||||
|
||||
export const apiDeleteServiceType = (id) =>
|
||||
http.delete(buildUrl(endpoints.deleteServiceType, { id }))
|
||||
Reference in New Issue
Block a user