Skip to content

Commit

Permalink
#1918 - updated code for code climate
Browse files Browse the repository at this point in the history
  • Loading branch information
Brajesh Kumar authored and Brajesh Kumar committed Oct 27, 2023
1 parent 3bf6163 commit 823442e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/app/core/export/download-service/download.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,11 @@ export class DownloadService {
});

const columnKeys: string[] = Array.from(columnLabels.keys());
const labels:any[] = Array.from(columnLabels.values());
const orderedData: any[] = [];
exportEntities.forEach((item) => {
const orderedItem: any[] = [];
columnKeys.forEach((key) => {
orderedItem.push(item[key]);
});
orderedData.push(orderedItem);
});

const labels: any[] = Array.from(columnLabels.values());
const orderedData: any[] = exportEntities.map(item =>
columnKeys.map(key => item[key])
);

return this.papa.unparse({
fields: labels,
data: orderedData,
Expand Down

0 comments on commit 823442e

Please sign in to comment.