refactor: collections versioning, migration and types

This commit is contained in:
Andrew Bastin
2021-08-24 23:12:53 +05:30
parent d1b2539d67
commit 6e9f16d8f1
5 changed files with 415 additions and 58 deletions

View File

@@ -33,7 +33,8 @@
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api"
import { addGraphqlCollection } from "~/newstore/collections"
import { HoppGQLRequest } from "~/helpers/types/HoppGQLRequest"
import { addGraphqlCollection, makeCollection } from "~/newstore/collections"
export default defineComponent({
props: {
@@ -53,11 +54,13 @@ export default defineComponent({
return
}
addGraphqlCollection({
name: this.name,
folders: [],
requests: [],
})
addGraphqlCollection(
makeCollection<HoppGQLRequest>({
name: this.name,
folders: [],
requests: [],
})
)
this.hideModal()
},

View File

@@ -29,14 +29,15 @@
</template>
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api"
import { defineComponent, PropType } from "@nuxtjs/composition-api"
import { HoppGQLRequest } from "~/helpers/types/HoppGQLRequest"
import { editGraphqlRequest } from "~/newstore/collections"
export default defineComponent({
props: {
show: Boolean,
folderPath: { type: String, default: null },
request: { type: Object, default: () => {} },
request: { type: Object as PropType<HoppGQLRequest>, default: () => {} },
requestIndex: { type: Number, default: null },
},
data() {