fix: fix remote browser socket connection and related updates
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user