diff --git a/lerna.json b/lerna.json index 9a9a8bff1f..6d08b39400 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.10.16-alpha.13", + "version": "2.10.16-alpha.15", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 5f1c8044d9..1c64dfe5ec 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -85,7 +85,7 @@ } let relationshipMap = { - [RelationshipType.MANY_TO_ONE]: { + [RelationshipType.ONE_TO_MANY]: { part1: PrettyRelationshipDefinitions.MANY, part2: PrettyRelationshipDefinitions.ONE, }, @@ -93,7 +93,7 @@ part1: PrettyRelationshipDefinitions.MANY, part2: PrettyRelationshipDefinitions.MANY, }, - [RelationshipType.ONE_TO_MANY]: { + [RelationshipType.MANY_TO_ONE]: { part1: PrettyRelationshipDefinitions.ONE, part2: PrettyRelationshipDefinitions.MANY, }, diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index bfa7c6cbd2..bb003730b3 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -60,6 +60,12 @@ // even if they are not in the inital fetch results initialValuesProcessed = true optionsObj = (fieldState?.value || []).reduce((accumulator, value) => { + // fieldState has to be an array of strings to be valid for an update + // therefore we cannot guarantee value will be an object + // https://linear.app/budibase/issue/BUDI-7577/refactor-the-relationshipfield-component-to-have-better-support-for + if (!value._id) { + return accumulator + } accumulator[value._id] = { _id: value._id, [primaryDisplay]: value.primaryDisplay,