fix: add JWT middleware to private API routes

This commit is contained in:
Kailasdevdas
2026-04-08 16:44:41 +05:30
parent 9c44c66b22
commit fb298cb846
7 changed files with 21 additions and 17 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ import {
getDoctorTimings,
getDoctorTimingById,
getDoctorByDoctorId,
getDoctorsByDepartmentId,
} from "../controllers/doctor.controller.js";
import jwtAuthMiddleware from "../middleware/auth.js";
@@ -14,9 +15,10 @@ import jwtAuthMiddleware from "../middleware/auth.js";
const router = express.Router();
router.get("/getAll", getAllDoctors);
router.get("/:doctorId", getDoctorByDoctorId);
router.get("/search", getDoctorsByDepartmentId);
router.get("/getTimings", getDoctorTimings);
router.get("/getTimings/:doctorId", getDoctorTimingById);
router.get("/:doctorId", getDoctorByDoctorId);
router.post("/", jwtAuthMiddleware, createDoctor);
router.patch("/:doctorId", jwtAuthMiddleware, updateDoctor);