1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Saving pre filled relation picker doesnt work (#11928)

* Make sure field state is valid

* Skip non-object relationship links

* Note

---------

Co-authored-by: Adria Navarro <adria@budibase.com>
This commit is contained in:
melohagan 2023-09-29 14:47:07 +01:00 committed by GitHub
parent 64fdb621e5
commit f22cce9553

View file

@ -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,