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: split importers list

liyasthomasd5866fbb3b3f
diff --git a/packages/hoppscotch-app/components/collections/ImportExport.vue b/packages/hoppscotch-app/components/collections/ImportExport.vue
index 85808b8cb..64e66af57 100644
--- a/packages/hoppscotch-app/components/collections/ImportExport.vue
+++ b/packages/hoppscotch-app/components/collections/ImportExport.vue
@@ -178,7 +178,7 @@ import {
Collection,
makeCollection,
} from "~/newstore/collections"
-import { RESTCollectionImporters } from "~/helpers/import-export/import"
+import { RESTCollectionImporters } from "~/helpers/import-export/import/importers"
const props = defineProps<{
show: boolean
@@ -663,11 +663,11 @@ const exportJSON = () => {
}
const importerType = ref(0)
-const importer = RESTCollectionImporters[importerType.value]
-const importerSteps = importer.steps
+const importerModule = RESTCollectionImporters[importerType.value]
+const importerSteps = importerModule.steps
const importerAction = async (content: string) => {
- const result = await importer.importer([content])()
+ const result = await importerModule.importer([content])()
if (E.isLeft(result)) {
console.log("error", result.left)
} else if (E.isRight(result)) {
diff --git a/packages/hoppscotch-app/helpers/import-export/import/importers.ts b/packages/hoppscotch-app/helpers/import-export/import/importers.ts
new file mode 100644
index 000000000..ebf73e5c5
--- /dev/null
+++ b/packages/hoppscotch-app/helpers/import-export/import/importers.ts
@@ -0,0 +1,3 @@
+import HoppRESTCollImporter from "./hopp"
+
+export const RESTCollectionImporters = [HoppRESTCollImporter] as const
diff --git a/packages/hoppscotch-app/helpers/import-export/import/index.ts b/packages/hoppscotch-app/helpers/import-export/import/index.ts
index f34b172ce..002fa7cc6 100644
--- a/packages/hoppscotch-app/helpers/import-export/import/index.ts
+++ b/packages/hoppscotch-app/helpers/import-export/import/index.ts
@@ -1,6 +1,5 @@
import * as TE from "fp-ts/TaskEither"
import { StepsOutputList } from "../steps"
-import HoppRESTCollImporter from "../import/hopp"
/**
* The error state to be used when the file formats do not match
@@ -46,5 +45,3 @@ export const defineImporter = <ReturnType, StepType>(input: {
...input,
}
}
-
-export const RESTCollectionImporters = [HoppRESTCollImporter] as const