refactor: update environment variables precedence order
This commit is contained in:
@@ -71,14 +71,14 @@ const getTestableBody = (
|
||||
|
||||
const combineEnvVariables = (variables: {
|
||||
environments: {
|
||||
global: Environment["variables"]
|
||||
selected: Environment["variables"]
|
||||
global: Environment["variables"]
|
||||
}
|
||||
requestVariables: Environment["variables"]
|
||||
}) => [
|
||||
...variables.requestVariables,
|
||||
...variables.environments.global,
|
||||
...variables.environments.selected,
|
||||
...variables.environments.global,
|
||||
]
|
||||
|
||||
export const executedResponses$ = new Subject<
|
||||
|
||||
@@ -14,8 +14,8 @@ import { SecretEnvironmentService } from "~/services/secret-environment.service"
|
||||
const secretEnvironmentService = getService(SecretEnvironmentService)
|
||||
|
||||
const unsecretEnvironments = (
|
||||
global: Environment["variables"],
|
||||
selected: Environment
|
||||
selected: Environment,
|
||||
global: Environment["variables"]
|
||||
) => {
|
||||
const resolvedGlobalWithSecrets = global.map((globalVar, index) => {
|
||||
const secretVar = secretEnvironmentService.getSecretEnvironmentVariable(
|
||||
@@ -65,8 +65,8 @@ const unsecretEnvironments = (
|
||||
|
||||
export const getCombinedEnvVariables = () => {
|
||||
const reformedVars = unsecretEnvironments(
|
||||
getGlobalVariables(),
|
||||
getCurrentEnvironment()
|
||||
getCurrentEnvironment(),
|
||||
getGlobalVariables()
|
||||
)
|
||||
return {
|
||||
global: cloneDeep(reformedVars.global),
|
||||
|
||||
Reference in New Issue
Block a user