Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: preserve hierarchy during personal collection imports (#4815)

Chhavi Goyal622b753c55f7
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts
index 229d2eee7..b199604ca 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts
@@ -115,6 +115,7 @@ const recursivelySyncCollections = async (
collection.id = childCollectionId
collection.auth = returnedData.auth
collection.headers = returnedData.headers
+ parentCollectionID = childCollectionId
removeDuplicateGraphqlCollectionOrFolder(
childCollectionId,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts
index 60c1227d0..2012e0d4e 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts
@@ -120,6 +120,7 @@ const recursivelySyncCollections = async (
collection._ref_id = returnedData._ref_id ?? generateUniqueRefId("coll")
collection.auth = returnedData.auth
collection.headers = returnedData.headers
+ parentCollectionID = childCollectionId
removeDuplicateRESTCollectionOrFolder(
childCollectionId,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts
index 229d2eee7..b199604ca 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts
@@ -115,6 +115,7 @@ const recursivelySyncCollections = async (
collection.id = childCollectionId
collection.auth = returnedData.auth
collection.headers = returnedData.headers
+ parentCollectionID = childCollectionId
removeDuplicateGraphqlCollectionOrFolder(
childCollectionId,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts
index 60c1227d0..2012e0d4e 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts
@@ -120,6 +120,7 @@ const recursivelySyncCollections = async (
collection._ref_id = returnedData._ref_id ?? generateUniqueRefId("coll")
collection.auth = returnedData.auth
collection.headers = returnedData.headers
+ parentCollectionID = childCollectionId
removeDuplicateRESTCollectionOrFolder(
childCollectionId,