fix: string replacement on all occurances
This commit is contained in:
parent
8c333b1b89
commit
a660642bbb
4 changed files with 17 additions and 13 deletions
|
@ -94,7 +94,7 @@ export async function getNewsletterPrintoutsById(req: Request, res: Response): P
|
|||
let newsletter = await NewsletterService.getById(newsletterId);
|
||||
|
||||
let filesInFolder = FileSystemHelper.getFilesInDirectory(
|
||||
`newsletter/${newsletter.id}_${newsletter.title.replace(" ", "")}`
|
||||
`newsletter/${newsletter.id}_${newsletter.title.replaceAll(" ", "")}`
|
||||
);
|
||||
|
||||
res.json(filesInFolder);
|
||||
|
@ -114,7 +114,7 @@ export async function getNewsletterPrintoutByIdAndPrint(req: Request, res: Respo
|
|||
|
||||
let filepath = FileSystemHelper.formatPath(
|
||||
"newsletter",
|
||||
`${newsletter.id}_${newsletter.title.replace(" ", "")}`,
|
||||
`${newsletter.id}_${newsletter.title.replaceAll(" ", "")}`,
|
||||
filename
|
||||
);
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
|
|||
year: "numeric",
|
||||
})}`;
|
||||
|
||||
let filename = `${new Date().toISOString().split("T")[0]}_${iteration + 1}_Protokoll_${protocol.title.replace(
|
||||
let filename = `${new Date().toISOString().split("T")[0]}_${iteration + 1}_Protokoll_${protocol.title.replaceAll(
|
||||
/[^a-zA-Z0-9]/g,
|
||||
""
|
||||
)}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue