changed file storage path
This commit is contained in:
parent
dd72f37856
commit
f16c5d91ba
5 changed files with 8 additions and 6 deletions
|
@ -2,5 +2,5 @@
|
|||
node_modules/
|
||||
dist/
|
||||
.git/
|
||||
export/
|
||||
files/
|
||||
.env
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -130,6 +130,6 @@ dist
|
|||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
export
|
||||
files
|
||||
|
||||
.idea
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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[]) {
|
||||
|
|
Loading…
Reference in a new issue