refactor: update inheritence when moving request

This commit is contained in:
nivedin
2023-12-04 17:52:49 +05:30
committed by Andrew Bastin
parent 056a8a8719
commit 569c170fec
4 changed files with 74 additions and 10 deletions

View File

@@ -1,4 +1,8 @@
import { HoppCollection, HoppRESTRequest } from "@hoppscotch/data"
import {
HoppCollection,
HoppGQLRequest,
HoppRESTRequest,
} from "@hoppscotch/data"
import { getAffectedIndexes } from "./affectedIndex"
import { RESTTabService } from "~/services/tab/rest"
import { getService } from "~/modules/dioc"
@@ -53,9 +57,9 @@ export function resolveSaveContextOnRequestReorder(payload: {
}
export function getRequestsByPath(
collections: HoppCollection<HoppRESTRequest>[],
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[],
path: string
): HoppRESTRequest[] {
): HoppRESTRequest[] | HoppGQLRequest[] {
// path will be like this "0/0/1" these are the indexes of the folders
const pathArray = path.split("/").map((index) => parseInt(index))