From 8e087840cabe5e291121fef90568c73785d8157a Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 16 Oct 2022 16:06:44 +0800 Subject: [PATCH] fix: multiple = false --- .../core/client/src/collection-manager/interfaces/o2o.tsx | 2 +- packages/core/database/src/update-associations.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/collection-manager/interfaces/o2o.tsx b/packages/core/client/src/collection-manager/interfaces/o2o.tsx index 7ca51c319..a926ddf5c 100644 --- a/packages/core/client/src/collection-manager/interfaces/o2o.tsx +++ b/packages/core/client/src/collection-manager/interfaces/o2o.tsx @@ -436,7 +436,7 @@ export const obo: IField = { 'x-component': 'RecordPicker', 'x-component-props': { // mode: 'tags', - multiple: true, + multiple: false, fieldNames: { label: 'id', value: 'id', diff --git a/packages/core/database/src/update-associations.ts b/packages/core/database/src/update-associations.ts index e2d120173..716cdc209 100644 --- a/packages/core/database/src/update-associations.ts +++ b/packages/core/database/src/update-associations.ts @@ -258,6 +258,10 @@ export async function updateSingleAssociation( return false; } + if (Array.isArray(value)) { + throw new Error(`The value of '${key}' cannot be in array format`); + } + const { context, updateAssociationValues = [], transaction } = options; const keys = getKeysByPrefix(updateAssociationValues, key);