1
0
Fork 0
mirror of synced 2024-09-10 06:26:02 +12:00

Handle users on search input

This commit is contained in:
Adria Navarro 2023-10-09 13:21:27 +02:00
parent 6705b67b67
commit a5477f14d2

View file

@ -5,8 +5,10 @@ import {
Table, Table,
DocumentType, DocumentType,
SEPARATOR, SEPARATOR,
FieldSubtype,
} from "@budibase/types" } from "@budibase/types"
import { db as dbCore } from "@budibase/backend-core" import { db as dbCore } from "@budibase/backend-core"
import { utils } from "@budibase/shared-core"
function findColumnInQueries( function findColumnInQueries(
column: string, column: string,
@ -66,8 +68,14 @@ export function searchInputMapping(table: Table, options: SearchParams) {
for (let [key, column] of Object.entries(table.schema)) { for (let [key, column] of Object.entries(table.schema)) {
switch (column.type) { switch (column.type) {
case FieldType.BB_REFERENCE: case FieldType.BB_REFERENCE:
if (column.subtype === FieldTypeSubtypes.BB_REFERENCE.USER) { const subtype = column.subtype as FieldSubtype
userColumnMapping(key, options) switch (subtype) {
case FieldSubtype.USER:
case FieldSubtype.USERS:
userColumnMapping(key, options)
break
default:
utils.unreachable(subtype)
} }
break break
} }