feat: fix issue with the pre-request envs

This commit is contained in:
Andrew Bastin
2021-09-25 21:19:52 +05:30
parent 6751c50514
commit 680937e50b
3 changed files with 46 additions and 41 deletions

View File

@@ -3,7 +3,6 @@ import {
getCurrentEnvironment,
getGlobalVariables,
} from "~/newstore/environments"
import { getRESTRequest } from "~/newstore/RESTSession"
export const getCombinedEnvVariables = () => {
const variables: { key: string; value: string }[] = [...getGlobalVariables()]
@@ -24,8 +23,7 @@ export const getCombinedEnvVariables = () => {
return variables
}
export const getFinalEnvsFromPreRequest = () =>
runPreRequestScript(
getRESTRequest().preRequestScript,
getCombinedEnvVariables()
)
export const getFinalEnvsFromPreRequest = (
script: string,
envs: { key: string; value: string }[]
) => runPreRequestScript(script, envs)