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:
madresebanoo
2026-09-02 15:03:15 +04:30
parent 2eb7c68f9f
commit 887eb2589d
11 changed files with 420 additions and 7 deletions
+8
View File
@@ -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',
+12
View File
@@ -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 }))