updated added new routes there
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user