Merge branch 'feature/environment-variables' of github.com:Budibase/budibase into feature/environment-variables

This commit is contained in:
Peter Clement 2023-01-25 11:41:22 +00:00
commit e803c422a3
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) { export async function getWithEnvVars(datasourceId: string) {
const appDb = context.getAppDB() const appDb = context.getAppDB()
const datasource = await appDb.get(datasourceId) const datasource = await appDb.get(datasourceId)
const blocks = findHBSBlocks(JSON.stringify(datasource)) return enrichDatasourceWithValues(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) { export function isValid(datasource: Datasource) {