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( const linkedIds = (Array.isArray(val) ? val : [])?.map(
row => row?._id || row row => row?._id || row
) )
if (schema.relationshipType === "one-to-many") { if (
return linkedIds?.[0] schema.relationshipType === "one-to-many" ||
} else if (schema.type === "bb_reference_single") { schema.type === "bb_reference_single"
return val ) {
return linkedIds[0]
} else { } else {
return linkedIds return linkedIds
} }