diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 9c98bdc2e5..aa07fb630c 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -57,7 +57,8 @@ label: table.name, value: table._id, })) - $: valid = getErrorCount(errors) === 0 && allRequiredAttributesSet() + $: valid = + getErrorCount(errors) === 0 && allRequiredAttributesSet(relationshipType) $: isManyToMany = relationshipType === RelationshipType.MANY_TO_MANY $: isManyToOne = relationshipType === RelationshipType.MANY_TO_ONE @@ -114,7 +115,7 @@ return Object.entries(errors).filter(entry => !!entry[1]).length } - function allRequiredAttributesSet() { + function allRequiredAttributesSet(relationshipType) { const base = getTable(fromId) && getTable(toId) && fromColumn && toColumn if (relationshipType === RelationshipType.MANY_TO_ONE) { return base && fromPrimary && fromForeign