fix not being able to select relationship type

This commit is contained in:
Keviin Åberg Kultalahti 2021-02-15 17:37:07 +01:00
parent a42aecbfbe
commit 0f5e91b645
2 changed files with 7 additions and 5 deletions

View File

@ -38,9 +38,9 @@
{text: 'Many to many (N:N)', value: 'many-to-many',}, {text: 'Many to many (N:N)', value: 'many-to-many',},
{text: 'One to many (1:N)', value: 'one-to-many',} {text: 'One to many (1:N)', value: 'one-to-many',}
] ]
let relationshipType = 'many-to-many'; let types = ['Many to many (N:N)', 'One to many (1:N)']
$: console.log(relationshipType) let selectedRelationshipType = 'Many to many (N:N)'
let indexes = [...($backendUiStore.selectedTable.indexes || [])] let indexes = [...($backendUiStore.selectedTable.indexes || [])]
let confirmDeleteDialog let confirmDeleteDialog
@ -60,7 +60,7 @@
originalName, originalName,
field, field,
primaryDisplay, primaryDisplay,
relationshipType, relationshipType: relationshipTypes.find(type => type.value === selectedRelationshipType),
indexes, indexes,
}) })
return state return state
@ -199,8 +199,8 @@
<div> <div>
<Label grey extraSmall>Select relationship type</Label> <Label grey extraSmall>Select relationship type</Label>
<div class="radio-buttons"> <div class="radio-buttons">
{#each relationshipTypes as {text, value}} {#each types as type}
<Radio name="Relationship type" {value} bind:group={relationshipType} label={text} showLabel/> <Radio name="Relationship type" value={type} bind:group={selectedRelationshipType} label={type} showLabel/>
{/each} {/each}
</div> </div>
</div> </div>

View File

@ -31,6 +31,8 @@
function getPrettyName(row) { function getPrettyName(row) {
return row[linkedTable.primaryDisplay || "_id"] return row[linkedTable.primaryDisplay || "_id"]
} }
$: console.log(schema.relationshipType)
</script> </script>
{#if linkedTable.primaryDisplay == null} {#if linkedTable.primaryDisplay == null}