Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: issue with the request body from duplication being linked in memory fixes #1954

Andrew Bastin8c0508499451
diff --git a/packages/hoppscotch-app/components/collections/graphql/index.vue b/packages/hoppscotch-app/components/collections/graphql/index.vue
index 0305f0102..d490eed13 100644
--- a/packages/hoppscotch-app/components/collections/graphql/index.vue
+++ b/packages/hoppscotch-app/components/collections/graphql/index.vue
@@ -290,7 +290,7 @@ export default defineComponent({
},
duplicateRequest({ folderPath, request }) {
saveGraphqlRequestAs(folderPath, {
- ...request,
+ ...cloneDeep(request),
name: `${request.name} - ${this.$t("action.duplicate")}`,
})
},
diff --git a/packages/hoppscotch-app/components/collections/index.vue b/packages/hoppscotch-app/components/collections/index.vue
index e410afbac..e968e292e 100644
--- a/packages/hoppscotch-app/components/collections/index.vue
+++ b/packages/hoppscotch-app/components/collections/index.vue
@@ -688,7 +688,7 @@ export default defineComponent({
},
duplicateRequest({ folderPath, request }) {
saveRESTRequestAs(folderPath, {
- ...request,
+ ...cloneDeep(request),
name: `${request.name} - ${this.$t("action.duplicate")}`,
})
},