Skip to content

Commit

Permalink
Refactor/rename/move Patients Generate page and route
Browse files Browse the repository at this point in the history
  • Loading branch information
francisli committed Jan 10, 2025
1 parent 4518945 commit 9c5a0c4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Dashboard() {
</Title>
<Button
component={Link}
to="/admin/patients/generate"
to="/patients/generate"
target="_blank"
>
Print QR Codes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
import { useQuery } from '@tanstack/react-query';
import { QRCode } from 'react-qrcode-logo';

import classes from './AdminPatientsGenerate.module.css';
import classes from './PatientsGenerate.module.css';

/**
*
* @returns {React.ReactElement}
*/
function AdminPatientsGenerate() {
function PatientsGenerate() {
const [numPages, setNumPages] = useState(1);
const [layout, setLayout] = useState(12);
const { isLoading, data } = useQuery({
Expand Down Expand Up @@ -82,4 +82,4 @@ function AdminPatientsGenerate() {
</Container>
);
}
export default AdminPatientsGenerate;
export default PatientsGenerate;
10 changes: 5 additions & 5 deletions client/src/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ import Verify from './pages/verify/verify';

import Dashboard from './pages/dashboard/Dashboard';

import AdminPatientsGenerate from './pages/admin/patients/AdminPatientsGenerate';
import { Users } from './pages/users/Users';

import PendingUsers from './pages/users/PendingUsers';

import PatientRegistration from './pages/patients/register/PatientRegistration';
import PatientDetails from './pages/patients/patient-details/PatientDetails';
import Patients from './pages/patients/Patients';
import PatientsGenerate from './pages/patients/PatientsGenerate';

// roles in order of least to most privileged
export const ROLES = ['FIRST_RESPONDER', 'VOLUNTEER', 'STAFF', 'ADMIN'];

// these are routes that require authentication and authorization by role
export const AUTH_ROUTES = [
['ADMIN', ['users', 'users/pending']],
['STAFF', ['admin/patients/generate', 'patients']],
['STAFF', ['patients/generate', 'patients']],
['VOLUNTEER', ['patients/register/:patientId']],
['FIRST_RESPONDER', ['dashboard', 'patients/:patientId']],
];
Expand Down Expand Up @@ -157,8 +157,8 @@ export default [
],
},
{
path: 'admin/patients/generate',
element: <AdminPatientsGenerate />,
path: 'patients/generate',
element: <PatientsGenerate />,
},
],
},
Expand Down

0 comments on commit 9c5a0c4

Please sign in to comment.