updated added new routes there

This commit is contained in:
2025-06-20 14:27:30 +05:30
parent 1d2ae796cf
commit bbabb3b035
2 changed files with 83 additions and 5 deletions

View File

@@ -101,6 +101,20 @@ router.get(
}
);
// Get recent patients (paginated)
router.get("/recent", async (req: Request, res: Response) => {
try {
const limit = parseInt(req.query.limit as string) || 10;
const offset = parseInt(req.query.offset as string) || 0;
const recentPatients = await storage.getRecentPatients(limit, offset);
res.json(recentPatients);
} catch (error) {
console.error("Failed to retrieve recent patients:", error);
res.status(500).json({ message: "Failed to retrieve recent patients" });
}
});
// Create a new patient
router.post("/", async (req: Request, res: Response): Promise<any> => {
try {