From 52657fcce5e0ef024fcbb1772dd1ad530a9d6c2a Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 24 Sep 2024 17:36:41 +0200 Subject: [PATCH] fix: replaceAll in CSV export --- src/utils/report.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/report.ts b/src/utils/report.ts index 5da6e0f..0ea3b9e 100644 --- a/src/utils/report.ts +++ b/src/utils/report.ts @@ -88,16 +88,16 @@ export const getReportCSV = async (data: ReportTimeEntry[]): Promise => [ entry.date, entry.email, - '"' + entry.name?.replace('/"/g', '\\"') + '"', + '"' + entry.name?.replaceAll('"', '\\"') + '"', entry.company, entry.crew, - '"' + entry.customer.replace('/"/g', '\\"') + '"', - '"' + entry.task.name.replace('/"/g', '\\"') + '"', - '"' + entry.project.name.replace('/"/g', '\\"') + '"', + '"' + entry.customer.replaceAll('"', '\\"') + '"', + '"' + entry.task.name.replaceAll('"', '\\"') + '"', + '"' + entry.project.name.replaceAll('"', '\\"') + '"', entry.project.type, entry.project.plannedHours, entry.hours, - '"' + entry.description?.replace('/"/g', '\\"') + '"', + '"' + entry.description?.replaceAll('"', '\\"') + '"', entry.startHour, entry.endHour, ].join(',') + '\n';