Test fixes for view search
This commit is contained in:
parent
fac39b2ede
commit
f9e8689ce9
|
@ -36,7 +36,7 @@ export async function searchView(
|
|||
// Enrich saved query with ephemeral query params.
|
||||
// We prevent searching on any fields that are saved as part of the query, as
|
||||
// that could let users find rows they should not be allowed to access.
|
||||
let query: any = dataFilters.buildQuery(view.query ?? [])
|
||||
let query: any = dataFilters.buildQuery(view.query)
|
||||
if (body.query) {
|
||||
// Delete extraneous search params that cannot be overridden
|
||||
delete body.query.onEmptyFilter
|
||||
|
|
|
@ -428,7 +428,11 @@ const builderFilter = (expression: SearchFilter) => {
|
|||
return query
|
||||
}
|
||||
|
||||
export const buildQuery = (filter: SearchFilterGroup | SearchFilter[]) => {
|
||||
export const buildQuery = (filter?: SearchFilterGroup | SearchFilter[]) => {
|
||||
if (!filter) {
|
||||
return
|
||||
}
|
||||
|
||||
const parsedFilter = processSearchFilters(filter)
|
||||
|
||||
if (!parsedFilter) {
|
||||
|
|
Loading…
Reference in New Issue