Skip to content

Commit

Permalink
pretty print the json object while exporting to file, fix hasura#3690
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthikeyan committed Jan 13, 2020
1 parent dbfc9e2 commit b37bc12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion console/src/components/Common/utils/jsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ export const downloadObjectAsJsonFile = (fileName, object) => {
: fileName + jsonSuffix;

const dataString =
'data:' + contentType + ',' + encodeURIComponent(JSON.stringify(object));
'data:' +
contentType +
',' +
encodeURIComponent(JSON.stringify(object, null, 4));

downloadFile(fileNameWithSuffix, dataString);
};

0 comments on commit b37bc12

Please sign in to comment.