fix: collection parser for hopp importer
This commit is contained in:
committed by
Andrew Bastin
parent
681a957611
commit
a9292eed9e
@@ -8,10 +8,13 @@ import {
|
||||
translateToNewRESTCollection,
|
||||
} from "~/newstore/collections"
|
||||
|
||||
const importer: HoppImporter<Collection<HoppRESTRequest>> = (content) =>
|
||||
const importer: HoppImporter<Collection<HoppRESTRequest>[]> = (content) =>
|
||||
pipe(
|
||||
E.tryCatch(
|
||||
() => translateToNewRESTCollection(content),
|
||||
() =>
|
||||
JSON.parse(content).map((coll: any) =>
|
||||
translateToNewRESTCollection(coll)
|
||||
),
|
||||
() => IMPORTER_INVALID_FILE_FORMAT
|
||||
),
|
||||
TE.fromEither
|
||||
|
||||
@@ -30,7 +30,7 @@ export type HoppImporterDefintion<T> = {
|
||||
}
|
||||
|
||||
export const RESTCollectionImporters: HoppImporterDefintion<
|
||||
Collection<HoppRESTRequest>
|
||||
Collection<HoppRESTRequest>[]
|
||||
>[] = [
|
||||
{
|
||||
name: "Hoppscotch REST Collection",
|
||||
|
||||
Reference in New Issue
Block a user