fix : save request popup bug (#2324)
This commit is contained in:
@@ -233,6 +233,7 @@ const saveRequestAs = async () => {
|
|||||||
originLocation: "user-collection",
|
originLocation: "user-collection",
|
||||||
folderPath: picked.value.folderPath,
|
folderPath: picked.value.folderPath,
|
||||||
requestIndex: picked.value.requestIndex,
|
requestIndex: picked.value.requestIndex,
|
||||||
|
req: cloneDeep(requestUpdated),
|
||||||
})
|
})
|
||||||
|
|
||||||
requestSaved()
|
requestSaved()
|
||||||
@@ -249,6 +250,7 @@ const saveRequestAs = async () => {
|
|||||||
originLocation: "user-collection",
|
originLocation: "user-collection",
|
||||||
folderPath: picked.value.folderPath,
|
folderPath: picked.value.folderPath,
|
||||||
requestIndex: insertionIndex,
|
requestIndex: insertionIndex,
|
||||||
|
req: cloneDeep(requestUpdated),
|
||||||
})
|
})
|
||||||
|
|
||||||
requestSaved()
|
requestSaved()
|
||||||
@@ -265,6 +267,7 @@ const saveRequestAs = async () => {
|
|||||||
originLocation: "user-collection",
|
originLocation: "user-collection",
|
||||||
folderPath: `${picked.value.collectionIndex}`,
|
folderPath: `${picked.value.collectionIndex}`,
|
||||||
requestIndex: insertionIndex,
|
requestIndex: insertionIndex,
|
||||||
|
req: cloneDeep(requestUpdated),
|
||||||
})
|
})
|
||||||
|
|
||||||
requestSaved()
|
requestSaved()
|
||||||
@@ -293,6 +296,7 @@ const saveRequestAs = async () => {
|
|||||||
setRESTSaveContext({
|
setRESTSaveContext({
|
||||||
originLocation: "team-collection",
|
originLocation: "team-collection",
|
||||||
requestID: picked.value.requestID,
|
requestID: picked.value.requestID,
|
||||||
|
req: cloneDeep(requestUpdated),
|
||||||
})
|
})
|
||||||
} else if (picked.value.pickedType === "teams-folder") {
|
} else if (picked.value.pickedType === "teams-folder") {
|
||||||
if (!isHoppRESTRequest(requestUpdated))
|
if (!isHoppRESTRequest(requestUpdated))
|
||||||
@@ -319,6 +323,7 @@ const saveRequestAs = async () => {
|
|||||||
requestID: result.right.createRequestInCollection.id,
|
requestID: result.right.createRequestInCollection.id,
|
||||||
teamID: collectionsType.value.selectedTeam.id,
|
teamID: collectionsType.value.selectedTeam.id,
|
||||||
collectionID: picked.value.folderID,
|
collectionID: picked.value.folderID,
|
||||||
|
req: cloneDeep(requestUpdated),
|
||||||
})
|
})
|
||||||
|
|
||||||
requestSaved()
|
requestSaved()
|
||||||
@@ -348,6 +353,7 @@ const saveRequestAs = async () => {
|
|||||||
requestID: result.right.createRequestInCollection.id,
|
requestID: result.right.createRequestInCollection.id,
|
||||||
teamID: collectionsType.value.selectedTeam.id,
|
teamID: collectionsType.value.selectedTeam.id,
|
||||||
collectionID: picked.value.collectionID,
|
collectionID: picked.value.collectionID,
|
||||||
|
req: cloneDeep(requestUpdated),
|
||||||
})
|
})
|
||||||
|
|
||||||
requestSaved()
|
requestSaved()
|
||||||
|
|||||||
@@ -208,6 +208,7 @@
|
|||||||
import { computed, ref, watch } from "@nuxtjs/composition-api"
|
import { computed, ref, watch } from "@nuxtjs/composition-api"
|
||||||
import { isLeft, isRight } from "fp-ts/lib/Either"
|
import { isLeft, isRight } from "fp-ts/lib/Either"
|
||||||
import * as E from "fp-ts/Either"
|
import * as E from "fp-ts/Either"
|
||||||
|
import cloneDeep from "lodash/cloneDeep"
|
||||||
import {
|
import {
|
||||||
updateRESTResponse,
|
updateRESTResponse,
|
||||||
restEndpoint$,
|
restEndpoint$,
|
||||||
@@ -477,14 +478,21 @@ const saveRequest = () => {
|
|||||||
showSaveRequestModal.value = true
|
showSaveRequestModal.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (saveCtx.originLocation === "user-collection") {
|
if (saveCtx.originLocation === "user-collection") {
|
||||||
|
const req = getRESTRequest()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
editRESTRequest(
|
editRESTRequest(
|
||||||
saveCtx.folderPath,
|
saveCtx.folderPath,
|
||||||
saveCtx.requestIndex,
|
saveCtx.requestIndex,
|
||||||
getRESTRequest()
|
getRESTRequest()
|
||||||
)
|
)
|
||||||
|
setRESTSaveContext({
|
||||||
|
originLocation: "user-collection",
|
||||||
|
folderPath: saveCtx.folderPath,
|
||||||
|
requestIndex: saveCtx.requestIndex,
|
||||||
|
req: cloneDeep(req),
|
||||||
|
})
|
||||||
toast.success(`${t("request.saved")}`)
|
toast.success(`${t("request.saved")}`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setRESTSaveContext(null)
|
setRESTSaveContext(null)
|
||||||
@@ -505,6 +513,11 @@ const saveRequest = () => {
|
|||||||
if (E.isLeft(result)) {
|
if (E.isLeft(result)) {
|
||||||
toast.error(`${t("profile.no_permission")}`)
|
toast.error(`${t("profile.no_permission")}`)
|
||||||
} else {
|
} else {
|
||||||
|
setRESTSaveContext({
|
||||||
|
originLocation: "team-collection",
|
||||||
|
requestID: saveCtx.requestID,
|
||||||
|
req: cloneDeep(req),
|
||||||
|
})
|
||||||
toast.success(`${t("request.saved")}`)
|
toast.success(`${t("request.saved")}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user