1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

PR feedback. Switch single user init back to expect an array and take the result

This commit is contained in:
Dean 2024-08-08 12:29:39 +01:00
parent 5ccbec9668
commit bd2664218c

View file

@ -25,10 +25,11 @@
const linkedIds = (Array.isArray(val) ? val : [])?.map(
row => row?._id || row
)
if (schema.relationshipType === "one-to-many") {
return linkedIds?.[0]
} else if (schema.type === "bb_reference_single") {
return val
if (
schema.relationshipType === "one-to-many" ||
schema.type === "bb_reference_single"
) {
return linkedIds[0]
} else {
return linkedIds
}