fix: graphql save request emit payload (#2913)

This commit is contained in:
Nivedin
2023-02-01 15:20:13 +05:30
committed by GitHub
parent cd6e40f01c
commit f676f94278
2 changed files with 9 additions and 12 deletions

View File

@@ -225,6 +225,7 @@ import {
removeGraphqlCollection,
moveGraphqlRequest,
} from "~/newstore/collections"
import { Picked } from "~/helpers/types/HoppPicked"
const props = defineProps({
picked: { type: Object, default: null },
@@ -241,7 +242,7 @@ const t = useI18n()
// TODO: improve types plz
const emit = defineEmits<{
(e: "select", i: { picked: any }): void
(e: "select", i: Picked | null): void
(e: "edit-request", i: any): void
(e: "duplicate-request", i: any): void
(e: "add-request", i: any): void
@@ -277,10 +278,8 @@ const collectionIcon = computed(() => {
const pick = () => {
emit("select", {
picked: {
pickedType: "gql-my-collection",
collectionIndex: props.collectionIndex,
},
pickedType: "gql-my-collection",
collectionIndex: props.collectionIndex,
})
}
@@ -298,7 +297,7 @@ const removeCollection = () => {
props.picked?.pickedType === "gql-my-collection" &&
props.picked?.collectionIndex === props.collectionIndex
) {
emit("select", { picked: null })
emit("select", null)
}
removeGraphqlCollection(props.collectionIndex)
toast.success(`${t("state.deleted")}`)

View File

@@ -169,11 +169,9 @@ const isSelected = computed(
const pick = () => {
emit("select", {
picked: {
pickedType: "gql-my-request",
folderPath: props.folderPath,
requestIndex: props.requestIndex,
},
pickedType: "gql-my-request",
folderPath: props.folderPath,
requestIndex: props.requestIndex,
})
}
@@ -213,7 +211,7 @@ const removeRequest = () => {
props.picked.folderPath === props.folderPath &&
props.picked.requestIndex === props.requestIndex
) {
emit("select", { picked: null })
emit("select", null)
}
removeGraphqlRequest(props.folderPath, props.requestIndex)