Add some comma filtering to CSV creation
This commit is contained in:
parent
ae4cad89e1
commit
1bc4326cff
@ -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';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user