Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix(common): prevent duplication of request ID when duplicating requests (#5781)
Anwarul Islam194c9496aaf3
diff --git a/packages/hoppscotch-common/src/components/collections/graphql/index.vue b/packages/hoppscotch-common/src/components/collections/graphql/index.vueindex 7577b1213..cd454fc36 100644--- a/packages/hoppscotch-common/src/components/collections/graphql/index.vue+++ b/packages/hoppscotch-common/src/components/collections/graphql/index.vue@@ -512,8 +512,9 @@ const duplicateRequest = async ({}) => {const isValidToken = await handleTokenValidation()if (!isValidToken) return+ const { id: _, ...requestWithoutID } = requestsaveGraphqlRequestAs(folderPath, {- ...cloneDeep(request),+ ...cloneDeep(requestWithoutID),name: `${request.name} - ${t("action.duplicate")}`,})}diff --git a/packages/hoppscotch-common/src/components/collections/index.vue b/packages/hoppscotch-common/src/components/collections/index.vueindex 6a25a51f7..f0771c372 100644--- a/packages/hoppscotch-common/src/components/collections/index.vue+++ b/packages/hoppscotch-common/src/components/collections/index.vue@@ -1564,8 +1564,9 @@ const duplicateRequest = async (payload: {const { folderPath, request } = payloadif (!folderPath) return+ const { id: _, ...requestWithoutID } = requestconst newRequest = {- ...cloneDeep(request),+ ...cloneDeep(requestWithoutID),_ref_id: generateUniqueRefId("req"),name: `${request.name} - ${t("action.duplicate")}`,}