Use foreign key instead of parimary[0]

This commit is contained in:
Mel O'Hagan 2023-01-13 12:41:41 +00:00
parent 66c13a2a77
commit d7ae20ce21
1 changed files with 1 additions and 4 deletions

View File

@ -127,10 +127,7 @@
let fromPrimary let fromPrimary
$: { $: {
if (!fromPrimary && fromTable) { if (!fromPrimary && fromTable) {
const relationshipKey = fromRelationship?.fieldName fromPrimary = fromRelationship?.foreignKey
fromPrimary =
fromTable.primary.filter(val => val === relationshipKey)[0] ||
fromTable.primary[0]
} }
} }
$: isManyToMany = $: isManyToMany =