Merge pull request #10713 from Budibase/fix/internal-view-eval-fn

Fix for fetching Internal DB Views in QA cloud
This commit is contained in:
deanhannigan 2023-05-26 11:51:07 +01:00 committed by GitHub
commit bd50f32f0d
1 changed files with 2 additions and 3 deletions

View File

@ -25,9 +25,8 @@ export async function runView(
}))
)
let fn = (doc: Document, emit: any) => emit(doc._id)
;(0, eval)(
"fn = " + view?.map?.replace("function (doc)", "function (doc, emit)")
)
// BUDI-7060 -> indirect eval call appears to cause issues in cloud
eval("fn = " + view?.map?.replace("function (doc)", "function (doc, emit)"))
const queryFns: any = {
meta: view.meta,
map: fn,