fix: fix remote browser socket connection and related updates

This commit is contained in:
Gitead
2026-04-30 11:52:58 -04:00
parent 441cfcc8e3
commit d8f852741a
959 changed files with 13338 additions and 2208 deletions
@@ -84,7 +84,7 @@ router.put("/set-npi-provider/:appointmentId", async (req: Request, res: Respons
*/
router.post("/save-for-appointment", async (req: Request, res: Response) => {
try {
const { appointmentId, patientId, npiProviderId, procedures } = req.body;
const { appointmentId, patientId, npiProviderId, procedures, attachments } = req.body;
if (!appointmentId || isNaN(Number(appointmentId))) {
return res.status(400).json({ message: "Invalid appointmentId" });
@@ -100,6 +100,14 @@ router.post("/save-for-appointment", async (req: Request, res: Response) => {
(p) => String(p.procedureCode ?? "").trim() !== ""
);
const validAttachments = Array.isArray(attachments)
? (attachments as any[]).filter((a) => a?.filename).map((a) => ({
filename: String(a.filename),
mimeType: a.mimeType ?? null,
filePath: a.filePath ?? null,
}))
: undefined;
const count = await storage.saveForAppointment({
appointmentId: Number(appointmentId),
patientId: Number(patientId),
@@ -110,6 +118,7 @@ router.post("/save-for-appointment", async (req: Request, res: Response) => {
toothNumber: p.toothNumber || null,
toothSurface: p.toothSurface || null,
})),
attachments: validAttachments,
});
return res.json({ success: true, count });