This commit is contained in:
Joshen Lim committed 2022-07-26 21:48:32 +08:00
1 parent 3d4b9a492c
commit 27ffd07fd0
2 files changed
+5 -3

No files matched your search

@@ -90,7 +90,9 @@ const ColumnEditor: FC<Props> = ({
setErrors(updatedErrors)
}
const saveColumnForeignKey = (foreignKeyConfiguration: any) => {
const saveColumnForeignKey = (
foreignKeyConfiguration: { table: PostgresTable; column: PostgresColumn } | undefined
) => {
onUpdateField({
foreignKey: !isUndefined(foreignKeyConfiguration)
? {
@@ -15,7 +15,7 @@ interface Props {
metadata?: any
visible: boolean
closePanel: () => void
saveChanges: (value: any) => void
saveChanges: (value: { table: PostgresTable; column: PostgresColumn } | undefined) => void
}
const ForeignKeySelector: FC<Props> = ({
@@ -92,7 +92,7 @@ const ForeignKeySelector: FC<Props> = ({
}
setErrors(errors)
if (isEmpty(errors)) {
if (!selectedTable) {
if (!selectedTable || !selectedColumn) {
// Remove foreign key since no table selected
saveChanges(undefined)
} else {