refactor: update all hoppCollection type to remove generic pattern
This commit is contained in:
@@ -103,7 +103,7 @@ type ExportedUserCollectionGQL = {
|
||||
function exportedCollectionToHoppCollection(
|
||||
collection: ExportedUserCollectionREST | ExportedUserCollectionGQL,
|
||||
collectionType: "REST" | "GQL"
|
||||
): HoppCollection<HoppRESTRequest | HoppGQLRequest> {
|
||||
): HoppCollection {
|
||||
if (collectionType == "REST") {
|
||||
const restCollection = collection as ExportedUserCollectionREST
|
||||
const data =
|
||||
@@ -203,7 +203,7 @@ async function loadUserCollections(collectionType: "REST" | "GQL") {
|
||||
exportedCollectionToHoppCollection(
|
||||
collection,
|
||||
"REST"
|
||||
) as HoppCollection<HoppRESTRequest>
|
||||
) as HoppCollection
|
||||
)
|
||||
)
|
||||
: setGraphqlCollections(
|
||||
@@ -212,7 +212,7 @@ async function loadUserCollections(collectionType: "REST" | "GQL") {
|
||||
exportedCollectionToHoppCollection(
|
||||
collection,
|
||||
"GQL"
|
||||
) as HoppCollection<HoppGQLRequest>
|
||||
) as HoppCollection
|
||||
)
|
||||
)
|
||||
})
|
||||
@@ -748,7 +748,7 @@ export const def: CollectionsPlatformDef = {
|
||||
|
||||
function getCollectionPathFromCollectionID(
|
||||
collectionID: string,
|
||||
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[],
|
||||
collections: HoppCollection[],
|
||||
parentPath?: string
|
||||
): string | null {
|
||||
for (const collectionIndex in collections) {
|
||||
@@ -772,7 +772,7 @@ function getCollectionPathFromCollectionID(
|
||||
|
||||
function getRequestPathFromRequestID(
|
||||
requestID: string,
|
||||
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[],
|
||||
collections: HoppCollection[],
|
||||
parentPath?: string
|
||||
): { collectionPath: string; requestIndex: number } | null {
|
||||
for (const collectionIndex in collections) {
|
||||
@@ -804,7 +804,7 @@ function getRequestPathFromRequestID(
|
||||
function getRequestIndex(
|
||||
requestID: string,
|
||||
parentCollectionPath: string,
|
||||
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[]
|
||||
collections: HoppCollection[]
|
||||
) {
|
||||
const collection = navigateToFolderWithIndexPath(
|
||||
collections,
|
||||
|
||||
@@ -39,7 +39,7 @@ export const restRequestsMapper = createMapper<string, string>()
|
||||
// temp implementation untill the backend implements an endpoint that accepts an entire collection
|
||||
// TODO: use importCollectionsJSON to do this
|
||||
const recursivelySyncCollections = async (
|
||||
collection: HoppCollection<HoppRESTRequest>,
|
||||
collection: HoppCollection,
|
||||
collectionPath: string,
|
||||
parentUserCollectionID?: string
|
||||
) => {
|
||||
|
||||
@@ -36,7 +36,7 @@ export const gqlRequestsMapper = createMapper<string, string>()
|
||||
// temp implementation untill the backend implements an endpoint that accepts an entire collection
|
||||
// TODO: use importCollectionsJSON to do this
|
||||
const recursivelySyncCollections = async (
|
||||
collection: HoppCollection<HoppRESTRequest>,
|
||||
collection: HoppCollection,
|
||||
collectionPath: string,
|
||||
parentUserCollectionID?: string
|
||||
) => {
|
||||
|
||||
Reference in New Issue
Block a user