changed file storage path

This commit is contained in:
Julian Krauser 2025-01-04 09:35:35 +01:00
parent dd72f37856
commit f16c5d91ba
5 changed files with 8 additions and 6 deletions

View file

@ -143,7 +143,9 @@ export async function getProtocolPrintoutByIdAndPrint(req: Request, res: Respons
let printout = await ProtocolPrintoutService.getById(printoutId, protocolId);
res.sendFile(process.cwd() + `/export/${printout.filename}.pdf`, {
let filepath = FileSystemHelper.formatPath("protocol", printout.filename);
res.sendFile(filepath, {
headers: {
"Content-Type": "application/pdf",
},
@ -264,7 +266,7 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
let printout: CreateProtocolPrintoutCommand = {
title,
iteration: iteration + 1,
filename: FileSystemHelper.normalizePath("protocol", filename),
filename: `${filename}.pdf`,
protocolId,
};
await ProtocolPrintoutCommandHandler.create(printout);

View file

@ -29,7 +29,7 @@ export abstract class FileSystemHelper {
}
static formatPath(...args: string[]) {
return join(process.cwd(), "export", ...args);
return join(process.cwd(), "files", ...args);
}
static normalizePath(...args: string[]) {