-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatient.js
More file actions
18 lines (10 loc) · 780 Bytes
/
patient.js
File metadata and controls
18 lines (10 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import express from 'express';
import { protect, authorize } from '../middleware/authmiddleware.js';
import * as patientController from '../controllers/patient.js';
const router = express.Router();
router.get('/', protect, authorize('admin', 'doctor', 'receptionist','billing'), patientController.getPatients);
router.get('/:id', protect, authorize('admin', 'doctor', 'receptionist','billing'), patientController.getPatientById);
router.post('/', protect, authorize('admin', 'doctor', 'receptionist','billing'), patientController.createPatient);
router.put('/:id', protect, authorize('admin', 'doctor', 'receptionist','billing'), patientController.updatePatient);
router.delete('/:id', protect, authorize('admin'), patientController.deletePatient);
export default router;