This commit is contained in:
Adria Navarro 2024-10-16 13:02:53 +02:00
parent 830ed0cda2
commit ba80880ab6
1 changed files with 1 additions and 5 deletions

View File

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