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:
parent
8cf63278d8
commit
f82e8f1f20
|
@ -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
|
||||
}
|
||||
return enrichDatasourceWithValues(datasource)
|
||||
}
|
||||
|
||||
export function isValid(datasource: Datasource) {
|
||||
|
|
Loading…
Reference in New Issue