#2-protocol #10

Merged
jkeffects merged 14 commits from #2-protocol into main 2024-10-29 14:45:37 +00:00
Showing only changes of commit 624408c973 - Show all commits

View file

@ -140,9 +140,13 @@ export async function getProtocolPrintoutByIdAndPrint(req: Request, res: Respons
let protocolId = parseInt(req.params.protocolId); let protocolId = parseInt(req.params.protocolId);
let printoutId = parseInt(req.params.printoutId); let printoutId = parseInt(req.params.printoutId);
let printouts = await ProtocolPrintoutService.getById(printoutId, protocolId); let printout = await ProtocolPrintoutService.getById(printoutId, protocolId);
res.json(ProtocolPrintoutFactory.mapToSingle(printouts)); res.sendFile(process.cwd() + `/export/${printout.filename}.pdf`, {
headers: {
"Content-Type": "application/pdf",
},
});
} }
/** /**