refactor: update inheritence when moving request
This commit is contained in:
@@ -178,6 +178,7 @@
|
||||
"
|
||||
@select="$emit('select', $event)"
|
||||
@select-request="$emit('select-request', $event)"
|
||||
@drop-request="$emit('drop-request', $event)"
|
||||
/>
|
||||
<CollectionsGraphqlRequest
|
||||
v-for="(request, index) in collection.requests"
|
||||
@@ -241,10 +242,7 @@ import IconSettings2 from "~icons/lucide/settings-2"
|
||||
import { useToast } from "@composables/toast"
|
||||
import { useI18n } from "@composables/i18n"
|
||||
import { useColorMode } from "@composables/theming"
|
||||
import {
|
||||
removeGraphqlCollection,
|
||||
moveGraphqlRequest,
|
||||
} from "~/newstore/collections"
|
||||
import { removeGraphqlCollection } from "~/newstore/collections"
|
||||
import { Picked } from "~/helpers/types/HoppPicked"
|
||||
import { useService } from "dioc/vue"
|
||||
import { GQLTabService } from "~/services/tab/graphql"
|
||||
@@ -282,6 +280,14 @@ const emit = defineEmits<{
|
||||
): void
|
||||
(e: "edit-collection"): void
|
||||
(e: "select-request", i: any): void
|
||||
(
|
||||
e: "drop-request",
|
||||
payload: {
|
||||
folderPath: string
|
||||
requestIndex: string
|
||||
collectionIndex: number | null
|
||||
}
|
||||
): void
|
||||
}>()
|
||||
|
||||
// Template refs
|
||||
@@ -357,6 +363,10 @@ const dropEvent = ({ dataTransfer }: any) => {
|
||||
dragging.value = !dragging.value
|
||||
const folderPath = dataTransfer.getData("folderPath")
|
||||
const requestIndex = dataTransfer.getData("requestIndex")
|
||||
moveGraphqlRequest(folderPath, requestIndex, `${props.collectionIndex}`)
|
||||
emit("drop-request", {
|
||||
folderPath,
|
||||
requestIndex,
|
||||
collectionIndex: props.collectionIndex,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user