From 0f8aafb4c46a190ddc9d7a61077bea0d69069442 Mon Sep 17 00:00:00 2001 From: Georgii Karataev Date: Fri, 9 Aug 2024 14:11:57 +0200 Subject: [PATCH] fix(downloadFile): Use 'csv' value as a default format No jira. --- packages/utils/src/helpers/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/helpers/helpers.ts b/packages/utils/src/helpers/helpers.ts index 6e570a936..503396e51 100644 --- a/packages/utils/src/helpers/helpers.ts +++ b/packages/utils/src/helpers/helpers.ts @@ -11,7 +11,7 @@ export function mergeArraysByKey(arrays: Record[][], 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');