chore: add fallback url and add reqIndex for graphql saving

This commit is contained in:
nivedin
2024-04-24 20:46:27 +05:30
parent 0c993d0e90
commit 05ad84f372
4 changed files with 24 additions and 13 deletions

View File

@@ -1393,6 +1393,14 @@ export function editGraphqlRequest(
}
export function saveGraphqlRequestAs(path: string, request: HoppGQLRequest) {
// For calculating the insertion request index
const targetLocation = navigateToFolderWithIndexPath(
graphqlCollectionStore.value.state,
path.split("/").map((x) => parseInt(x))
)
const insertionIndex = targetLocation!.requests.length
graphqlCollectionStore.dispatch({
dispatcher: "saveRequestAs",
payload: {
@@ -1400,6 +1408,8 @@ export function saveGraphqlRequestAs(path: string, request: HoppGQLRequest) {
request,
},
})
return insertionIndex
}
export function removeGraphqlRequest(