fix(common): prevent duplication of request ID when duplicating requests (#5781)
This commit is contained in:
parent
4d862c2f4b
commit
194c9496aa
2 changed files with 4 additions and 2 deletions
|
|
@ -512,8 +512,9 @@ const duplicateRequest = async ({
|
||||||
}) => {
|
}) => {
|
||||||
const isValidToken = await handleTokenValidation()
|
const isValidToken = await handleTokenValidation()
|
||||||
if (!isValidToken) return
|
if (!isValidToken) return
|
||||||
|
const { id: _, ...requestWithoutID } = request
|
||||||
saveGraphqlRequestAs(folderPath, {
|
saveGraphqlRequestAs(folderPath, {
|
||||||
...cloneDeep(request),
|
...cloneDeep(requestWithoutID),
|
||||||
name: `${request.name} - ${t("action.duplicate")}`,
|
name: `${request.name} - ${t("action.duplicate")}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1564,8 +1564,9 @@ const duplicateRequest = async (payload: {
|
||||||
const { folderPath, request } = payload
|
const { folderPath, request } = payload
|
||||||
if (!folderPath) return
|
if (!folderPath) return
|
||||||
|
|
||||||
|
const { id: _, ...requestWithoutID } = request
|
||||||
const newRequest = {
|
const newRequest = {
|
||||||
...cloneDeep(request),
|
...cloneDeep(requestWithoutID),
|
||||||
_ref_id: generateUniqueRefId("req"),
|
_ref_id: generateUniqueRefId("req"),
|
||||||
name: `${request.name} - ${t("action.duplicate")}`,
|
name: `${request.name} - ${t("action.duplicate")}`,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue