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

@ -2,5 +2,5 @@
node_modules/
dist/
.git/
export/
files/
.env

2
.gitignore vendored
View file

@ -130,6 +130,6 @@ dist
.yarn/install-state.gz
.pnp.*
export
files
.idea

View file

@ -39,7 +39,7 @@ services:
- CLUB_NAME=<tobemodified>
- CLUB_WEBSITE=<tobemodified>
volumes:
- <volume|local path>:/app/export
- <volume|local path>:/app/files
networks:
- ff_internal
depends_on:

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[]) {