The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Fix wrong logic in updating form fields in table side panel editor for columns
Joshen Lim7142d63b6802
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsxindex 56e5bde642c..7d16dae6d5f 100644--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx@@ -85,11 +85,14 @@ const ColumnManagement: FC<Props> = ({const onUpdateColumn = (columnToUpdate: ColumnField, changes: Partial<ColumnField>) => {const updatedColumns = columns.map((column: ColumnField) => {if (column.id === columnToUpdate.id) {- const foreignKey =- 'name' in changes && !isUndefined(column.foreignKey)- ? { ...column.foreignKey, source_column_name: changes.name }- : column.foreignKey- return { ...column, ...changes, foreignKey: foreignKey as PostgresRelationship }+ if ('name' in changes && !isUndefined(column.foreignKey)) {+ const foreignKey: PostgresRelationship = {+ ...column.foreignKey,+ source_column_name: changes?.name ?? '',+ }+ return { ...column, ...changes, foreignKey }+ }+ return { ...column, ...changes }} else {return column}