Skip to content

Commit

Permalink
fix(downloadFile): Use 'csv' value as a default format (#2046)
Browse files Browse the repository at this point in the history
No jira.
  • Loading branch information
gkarat authored Aug 12, 2024
1 parent 7f75aa7 commit 1db3145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utils/src/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function mergeArraysByKey(arrays: Record<string, unknown>[][], key = 'id'
return Object.values(mergedObject);
}

export function downloadFile(data: unknown, filename = `${new Date().toISOString()}`, format = CSV_TYPE) {
export function downloadFile(data: unknown, filename = `${new Date().toISOString()}`, format = 'csv') {
const type = format === 'json' ? JSON_TYPE : CSV_TYPE;
const blob = new Blob([data as unknown as BlobPart], { type });
const link = document.createElement('a');
Expand Down

0 comments on commit 1db3145

Please sign in to comment.