From 0aa509e80469cafdcc6f339bf86845f8226537d7 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 6 Feb 2025 17:49:59 +0700 Subject: [PATCH] chore: prettify collection contents before export (#4687) Co-authored-by: Dmitry Mukovkin Co-authored-by: nivedin --- .../hoppscotch-common/src/components/collections/index.vue | 4 ++-- packages/hoppscotch-common/src/helpers/backend/helpers.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hoppscotch-common/src/components/collections/index.vue b/packages/hoppscotch-common/src/components/collections/index.vue index 6c083b60..f0656c38 100644 --- a/packages/hoppscotch-common/src/components/collections/index.vue +++ b/packages/hoppscotch-common/src/components/collections/index.vue @@ -2666,7 +2666,7 @@ const initializeDownloadCollection = async ( */ const exportData = async (collection: HoppCollection | TeamCollection) => { if (collectionsType.value.type === "my-collections") { - const collectionJSON = JSON.stringify(collection) + const collectionJSON = JSON.stringify(collection, null, 2) const name = (collection as HoppCollection).name @@ -2685,7 +2685,7 @@ const exportData = async (collection: HoppCollection | TeamCollection) => { }, async (coll) => { const hoppColl = teamCollToHoppRESTColl(coll) - const collectionJSONString = JSON.stringify(hoppColl) + const collectionJSONString = JSON.stringify(hoppColl, null, 2) await initializeDownloadCollection( collectionJSONString, diff --git a/packages/hoppscotch-common/src/helpers/backend/helpers.ts b/packages/hoppscotch-common/src/helpers/backend/helpers.ts index ca9f06a6..6f2478bf 100644 --- a/packages/hoppscotch-common/src/helpers/backend/helpers.ts +++ b/packages/hoppscotch-common/src/helpers/backend/helpers.ts @@ -254,5 +254,5 @@ export const getTeamCollectionJSON = async (teamID: string) => { } const hoppCollections = collections.map(teamCollectionJSONToHoppRESTColl) - return E.right(JSON.stringify(hoppCollections)) + return E.right(JSON.stringify(hoppCollections, null, 2)) }