fix issue with relationship selection
This commit is contained in:
parent
8c230f649e
commit
419c5ced70
|
@ -33,6 +33,10 @@
|
||||||
part1: PrettyRelationshipDefinitions.MANY,
|
part1: PrettyRelationshipDefinitions.MANY,
|
||||||
part2: PrettyRelationshipDefinitions.ONE,
|
part2: PrettyRelationshipDefinitions.ONE,
|
||||||
},
|
},
|
||||||
|
[RelationshipType.MANY_TO_ONE]: {
|
||||||
|
part1: PrettyRelationshipDefinitions.ONE,
|
||||||
|
part2: PrettyRelationshipDefinitions.MANY,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
let relationshipOpts1 = Object.values(PrettyRelationshipDefinitions)
|
let relationshipOpts1 = Object.values(PrettyRelationshipDefinitions)
|
||||||
let relationshipOpts2 = Object.values(PrettyRelationshipDefinitions)
|
let relationshipOpts2 = Object.values(PrettyRelationshipDefinitions)
|
||||||
|
@ -58,7 +62,7 @@
|
||||||
let fromPrimary, fromForeign, fromColumn, toColumn
|
let fromPrimary, fromForeign, fromColumn, toColumn
|
||||||
|
|
||||||
let throughId, throughToKey, throughFromKey
|
let throughId, throughToKey, throughFromKey
|
||||||
let isManyToMany, isManyToOne, relationshipType
|
let relationshipType
|
||||||
let hasValidated = false
|
let hasValidated = false
|
||||||
|
|
||||||
$: fromId = null
|
$: fromId = null
|
||||||
|
@ -85,8 +89,10 @@
|
||||||
$: valid =
|
$: valid =
|
||||||
getErrorCount(errors) === 0 && allRequiredAttributesSet(relationshipType)
|
getErrorCount(errors) === 0 && allRequiredAttributesSet(relationshipType)
|
||||||
$: isManyToMany = relationshipType === RelationshipType.MANY_TO_MANY
|
$: isManyToMany = relationshipType === RelationshipType.MANY_TO_MANY
|
||||||
$: isManyToOne = relationshipType === RelationshipType.MANY_TO_ONE
|
$: isManyToOne =
|
||||||
|
relationshipType === RelationshipType.MANY_TO_ONE ||
|
||||||
|
relationshipType === RelationshipType.ONE_TO_MANY
|
||||||
|
$: console.log(relationshipType)
|
||||||
function getTable(id) {
|
function getTable(id) {
|
||||||
return plusTables.find(table => table._id === id)
|
return plusTables.find(table => table._id === id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue