Add some comma filtering to CSV creation

This commit is contained in:
Stedoss 2025-02-28 16:52:13 +00:00
parent ae4cad89e1
commit 1bc4326cff

View File

@ -23,7 +23,15 @@ export class DownloadFilesService {
for (const row of input) {
let rowData: string[] = [];
for (const column of columns) {
rowData.push((row as Record<string, string>)[column]);
let value = (row as Record<string, any>)[column];
if (typeof value === 'string') {
value = value.replaceAll(',', ';');
} else if (Array.isArray(value)) {
value = value.join(';');
}
rowData.push(value);
}
csvData += rowData.join(',') + '\n';