1
0
Fork 0
mirror of synced 2024-08-15 18:11:40 +12:00

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

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
}
return enrichDatasourceWithValues(datasource)
}
export function isValid(datasource: Datasource) {