Use foreign key instead of parimary[0]
This commit is contained in:
parent
66c13a2a77
commit
d7ae20ce21
|
@ -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 =
|
||||||
|
|
Loading…
Reference in New Issue