diff --git a/hms-ui/src/api/departments.ts b/hms-ui/src/api/departments.ts index 7817b2a..ea075b4 100644 --- a/hms-ui/src/api/departments.ts +++ b/hms-ui/src/api/departments.ts @@ -1,5 +1,5 @@ import api from './axiosInstance'; -import type { ApiResponse, Department } from '../types'; +import type { ApiResponse, Department, PaginatedResponse } from '../types'; export const getDepartments = (params?: { page?: number; size?: number }) => - api.get>('/departments', { params }); + api.get>>('/departments', { params }); diff --git a/hms-ui/src/constants/roles.ts b/hms-ui/src/constants/roles.ts new file mode 100644 index 0000000..7b4f468 --- /dev/null +++ b/hms-ui/src/constants/roles.ts @@ -0,0 +1,16 @@ +export const ROLES = { + ADMIN: 'ROLE_ADMIN', + DOCTOR: 'ROLE_DOCTOR', + RECEPTIONIST: 'ROLE_RECEPTIONIST', + PHARMACIST: 'ROLE_PHARMACIST', + CASHIER: 'ROLE_CASHIER', + PATIENT: 'ROLE_PATIENT', +} as const; + +export const ROLE_NAMES = { + ADMIN: 'ADMIN', + DOCTOR: 'DOCTOR', + RECEPTIONIST: 'RECEPTIONIST', + PHARMACIST: 'PHARMACIST', + CASHIER: 'CASHIER', +} as const; diff --git a/hms-ui/src/pages/admin/CreateEmployeePage.tsx b/hms-ui/src/pages/admin/CreateEmployeePage.tsx index 6d85677..527034c 100644 --- a/hms-ui/src/pages/admin/CreateEmployeePage.tsx +++ b/hms-ui/src/pages/admin/CreateEmployeePage.tsx @@ -6,6 +6,7 @@ import { useState } from 'react'; import { createEmployee } from '../../api/employees'; import { getDepartments } from '../../api/departments'; import type { CreateEmployeeRequest } from '../../types'; +import { ROLE_NAMES } from '../../constants/roles'; import dayjs from 'dayjs'; const { Title } = Typography; @@ -154,17 +155,17 @@ export default function CreateEmployeePage() {