This commit is contained in:
Sam Rose 2024-09-25 15:41:18 +01:00
parent b68a51bd55
commit 564e16fd5c
No known key found for this signature in database
2 changed files with 16 additions and 8 deletions

View File

@ -2757,7 +2757,7 @@ describe.each([
})
})
it.only("can filter by the row ID with limit 1", async () => {
it("can filter by the row ID with limit 1", async () => {
await expectSearch({
query: {
equal: { _id: row._id },

View File

@ -45,6 +45,7 @@ import {
import {
dataFilters,
helpers,
isInternalColumnName,
PROTECTED_INTERNAL_COLUMNS,
} from "@budibase/shared-core"
import { isSearchingByRowID } from "../utils"
@ -130,15 +131,22 @@ function cleanupFilters(
// generate a map of all possible column names (these can be duplicated across tables
// the map of them will always be the same
const userColumnMap: Record<string, string> = {}
allTables.forEach(table =>
Object.keys(table.schema).forEach(
key => (userColumnMap[key] = mapToUserColumn(key))
)
)
for (const table of allTables) {
for (const key of Object.keys(table.schema)) {
if (isInternalColumnName(key)) {
continue
}
userColumnMap[key] = mapToUserColumn(key)
}
}
// update the keys of filters to manage user columns
const keyInAnyTable = (key: string): boolean =>
allTables.some(table => table.schema[key])
const keyInAnyTable = (key: string): boolean => {
if (isInternalColumnName(key)) {
return false
}
return allTables.some(table => table.schema[key])
}
const splitter = new dataFilters.ColumnSplitter(allTables)