Don't check whether or not a datasource uses env vars when the function specifically includes the env vars, always fetch them so that they can be returned and put into context for queries to use.

This commit is contained in:
mike12345567 2023-01-24 18:56:19 +00:00
parent 22e1c1cccf
commit 6349b08888
1 changed files with 1 additions and 8 deletions

View File

@ -43,14 +43,7 @@ export async function get(
export async function getWithEnvVars(datasourceId: string) {
const appDb = context.getAppDB()
const datasource = await appDb.get(datasourceId)
const blocks = findHBSBlocks(JSON.stringify(datasource))
const usesEnvVars =
blocks.find(block => block.includes(ENV_VAR_PREFIX)) != null
if (usesEnvVars) {
return enrichDatasourceWithValues(datasource)
} else {
return datasource
}
}
export function isValid(datasource: Datasource) {