document page updated

This commit is contained in:
2025-07-17 19:21:16 +05:30
parent aa913673de
commit 1071b80930
11 changed files with 838 additions and 1089 deletions

View File

@@ -33,6 +33,24 @@ router.post(
}
);
router.get(
"/pdf-groups/patient/:patientId",
async (req: Request, res: Response): Promise<any> => {
try {
const { patientId } = req.params;
if (!patientId) {
return res.status(400).json({ error: "Missing patient ID" });
}
const groups = await storage.getPdfGroupsByPatientId(parseInt(patientId));
res.json(groups);
} catch (err) {
console.error("Error fetching groups by patient ID:", err);
res.status(500).json({ error: "Internal server error" });
}
}
);
router.get(
"/pdf-groups/:id",
async (req: Request, res: Response): Promise<any> => {
@@ -126,6 +144,21 @@ router.post(
}
);
router.get("/pdf-files/group/:groupId", async (req: Request, res: Response):Promise<any> => {
try {
const idParam = req.params.groupId;
if (!idParam) {
return res.status(400).json({ error: "Missing Groupt ID" });
}
const groupId = parseInt(idParam);
const files = await storage.getPdfFilesByGroupId(groupId); // implement this
res.json(files);
} catch (err) {
res.status(500).json({ error: "Internal server error" });
}
});
router.get(
"/pdf-files/:id",
async (req: Request, res: Response): Promise<any> => {