#2-protocol #10
1 changed files with 6 additions and 2 deletions
|
@ -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",
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue