Fix
This commit is contained in:
parent
830ed0cda2
commit
ba80880ab6
|
@ -37,7 +37,6 @@ import * as exporters from "../view/exporters"
|
||||||
import { Format } from "../view/exporters"
|
import { Format } from "../view/exporters"
|
||||||
import { apiFileReturn } from "../../../utilities/fileSystem"
|
import { apiFileReturn } from "../../../utilities/fileSystem"
|
||||||
import { dataFilters } from "@budibase/shared-core"
|
import { dataFilters } from "@budibase/shared-core"
|
||||||
import { isPlainObject } from "lodash"
|
|
||||||
|
|
||||||
export * as views from "./views"
|
export * as views from "./views"
|
||||||
|
|
||||||
|
@ -217,7 +216,7 @@ export async function search(ctx: Ctx<SearchRowRequest, SearchRowResponse>) {
|
||||||
await context.ensureSnippetContext(true)
|
await context.ensureSnippetContext(true)
|
||||||
|
|
||||||
let { query } = ctx.request.body
|
let { query } = ctx.request.body
|
||||||
if (query && !isPlainObject(query)) {
|
if (query) {
|
||||||
const allTables = await sdk.tables.getAllTables()
|
const allTables = await sdk.tables.getAllTables()
|
||||||
query = replaceTableNamesInFilters(tableId, query, allTables)
|
query = replaceTableNamesInFilters(tableId, query, allTables)
|
||||||
}
|
}
|
||||||
|
@ -243,9 +242,6 @@ function replaceTableNamesInFilters(
|
||||||
allTables: Table[]
|
allTables: Table[]
|
||||||
): SearchFilters {
|
): SearchFilters {
|
||||||
for (const filter of Object.values(filters)) {
|
for (const filter of Object.values(filters)) {
|
||||||
if (!isPlainObject(filter)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for (const key of Object.keys(filter)) {
|
for (const key of Object.keys(filter)) {
|
||||||
const matches = key.match(`^(?<relation>.+)\\.(?<field>.+)`)
|
const matches = key.match(`^(?<relation>.+)\\.(?<field>.+)`)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue