Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: format JSON in data export (#15175)

ecmadao1163673ef0e5
diff --git a/frontend/src/components/DataExportButton.vue b/frontend/src/components/DataExportButton.vue
index 97153ef326..c0fd79641c 100644
--- a/frontend/src/components/DataExportButton.vue
+++ b/frontend/src/components/DataExportButton.vue
@@ -306,7 +306,7 @@ const getExportFileType = (format: ExportFormat) => {
}
};
-const doDownload = (
+const doDownload = async (
content: BinaryLike | Blob,
options: ExportOption,
filename: string
@@ -315,9 +315,17 @@ const doDownload = (
const fileType = isZip
? "application/zip"
: getExportFileType(options.format);
- const blob = new Blob([content], {
+
+ let blob = new Blob([content], {
type: fileType,
});
+ if (options.format === ExportFormat.JSON) {
+ const text = await blob.text();
+ const formatted = JSON.stringify(JSON.parse(text), null, 2);
+ blob = new Blob([formatted], {
+ type: fileType,
+ });
+ }
const url = window.URL.createObjectURL(blob);
const fileFormat = exportFormatToJSON(options.format).toLowerCase();