wip
This commit is contained in:
parent
b68a51bd55
commit
564e16fd5c
|
@ -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({
|
await expectSearch({
|
||||||
query: {
|
query: {
|
||||||
equal: { _id: row._id },
|
equal: { _id: row._id },
|
||||||
|
|
|
@ -45,6 +45,7 @@ import {
|
||||||
import {
|
import {
|
||||||
dataFilters,
|
dataFilters,
|
||||||
helpers,
|
helpers,
|
||||||
|
isInternalColumnName,
|
||||||
PROTECTED_INTERNAL_COLUMNS,
|
PROTECTED_INTERNAL_COLUMNS,
|
||||||
} from "@budibase/shared-core"
|
} from "@budibase/shared-core"
|
||||||
import { isSearchingByRowID } from "../utils"
|
import { isSearchingByRowID } from "../utils"
|
||||||
|
@ -130,15 +131,22 @@ function cleanupFilters(
|
||||||
// generate a map of all possible column names (these can be duplicated across tables
|
// generate a map of all possible column names (these can be duplicated across tables
|
||||||
// the map of them will always be the same
|
// the map of them will always be the same
|
||||||
const userColumnMap: Record<string, string> = {}
|
const userColumnMap: Record<string, string> = {}
|
||||||
allTables.forEach(table =>
|
for (const table of allTables) {
|
||||||
Object.keys(table.schema).forEach(
|
for (const key of Object.keys(table.schema)) {
|
||||||
key => (userColumnMap[key] = mapToUserColumn(key))
|
if (isInternalColumnName(key)) {
|
||||||
)
|
continue
|
||||||
)
|
}
|
||||||
|
userColumnMap[key] = mapToUserColumn(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// update the keys of filters to manage user columns
|
// update the keys of filters to manage user columns
|
||||||
const keyInAnyTable = (key: string): boolean =>
|
const keyInAnyTable = (key: string): boolean => {
|
||||||
allTables.some(table => table.schema[key])
|
if (isInternalColumnName(key)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return allTables.some(table => table.schema[key])
|
||||||
|
}
|
||||||
|
|
||||||
const splitter = new dataFilters.ColumnSplitter(allTables)
|
const splitter = new dataFilters.ColumnSplitter(allTables)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue