diff --git a/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts b/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts index 18dc4ef3f0..0698f727df 100644 --- a/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts +++ b/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts @@ -19,7 +19,7 @@ const tableWithUserCol: Table = { schema: { user: { name: "user", - type: FieldType.BB_REFERENCE, + type: FieldType.BB_REFERENCE_SINGLE, subtype: BBReferenceFieldSubType.USER, }, }, @@ -35,7 +35,7 @@ const tableWithUsersCol: Table = { user: { name: "user", type: FieldType.BB_REFERENCE, - subtype: BBReferenceFieldSubType.USERS, + subtype: BBReferenceFieldSubType.USER, }, }, } diff --git a/packages/server/src/sdk/app/rows/search/utils.ts b/packages/server/src/sdk/app/rows/search/utils.ts index fc0c218e71..109a7c5a82 100644 --- a/packages/server/src/sdk/app/rows/search/utils.ts +++ b/packages/server/src/sdk/app/rows/search/utils.ts @@ -86,6 +86,16 @@ export function searchInputMapping(table: Table, options: RowSearchParams) { } for (let [key, column] of Object.entries(table.schema)) { switch (column.type) { + case FieldType.BB_REFERENCE_SINGLE: + const subtype = column.subtype + switch (subtype) { + case BBReferenceFieldSubType.USER: + userColumnMapping(key, options) + break + default: + utils.unreachable(subtype) + } + break case FieldType.BB_REFERENCE: { const subtype = column.subtype switch (subtype) { diff --git a/packages/types/src/documents/app/table/schema.ts b/packages/types/src/documents/app/table/schema.ts index eb5eecd423..03d57aced8 100644 --- a/packages/types/src/documents/app/table/schema.ts +++ b/packages/types/src/documents/app/table/schema.ts @@ -116,7 +116,7 @@ export interface BBReferenceFieldMetadata export interface BBReferenceSingleFieldMetadata extends Omit { type: FieldType.BB_REFERENCE_SINGLE - subtype: BBReferenceFieldSubType + subtype: Exclude } export interface AttachmentFieldMetadata extends BaseFieldSchema {