refactor: move collection data structures and utility functions to hopp/data

This commit is contained in:
Andrew Bastin
2022-01-20 23:55:23 +05:30
parent 6b0494ddba
commit 5043606701
17 changed files with 156 additions and 124 deletions

View File

@@ -164,7 +164,7 @@
<script setup lang="ts">
import { computed, ref, watch } from "@nuxtjs/composition-api"
import * as E from "fp-ts/Either"
import { HoppRESTRequest } from "@hoppscotch/data"
import { HoppRESTRequest, HoppCollection } from "@hoppscotch/data"
import { apolloClient } from "~/helpers/apollo"
import {
useAxios,
@@ -174,11 +174,7 @@ import {
} from "~/helpers/utils/composables"
import { currentUser$ } from "~/helpers/fb/auth"
import * as teamUtils from "~/helpers/teams/utils"
import {
appendRESTCollections,
Collection,
restCollections$,
} from "~/newstore/collections"
import { appendRESTCollections, restCollections$ } from "~/newstore/collections"
import { RESTCollectionImporters } from "~/helpers/import-export/import/importers"
import { StepReturnValue } from "~/helpers/import-export/steps"
@@ -285,7 +281,7 @@ watch(mySelectedCollectionID, (newValue) => {
const importingMyCollections = ref(false)
const importToTeams = async (content: Collection<HoppRESTRequest>) => {
const importToTeams = async (content: HoppCollection<HoppRESTRequest>) => {
importingMyCollections.value = true
if (props.collectionsType.type !== "team-collections") return
await teamUtils

View File

@@ -34,8 +34,8 @@
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api"
import { HoppGQLRequest } from "@hoppscotch/data"
import { addGraphqlCollection, makeCollection } from "~/newstore/collections"
import { HoppGQLRequest, makeCollection } from "@hoppscotch/data"
import { addGraphqlCollection } from "~/newstore/collections"
export default defineComponent({
props: {