From 54642627b3f413d9e09c11cefc490c993439541b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 03:03:50 +0000 Subject: [PATCH] Fix: Remove hardcoded dataTypes defaults, make them required props from config Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- src/components/admin/ColumnDialog.tsx | 4 ++-- src/components/admin/CreateTableDialog.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/admin/ColumnDialog.tsx b/src/components/admin/ColumnDialog.tsx index bb7db87..2269a95 100644 --- a/src/components/admin/ColumnDialog.tsx +++ b/src/components/admin/ColumnDialog.tsx @@ -22,7 +22,7 @@ type ColumnDialogProps = { columns?: Array<{ column_name: string }>; onClose: () => void; onSubmit: (data: any) => Promise; - dataTypes?: string[]; + dataTypes: string[]; }; export default function ColumnDialog({ @@ -32,7 +32,7 @@ export default function ColumnDialog({ columns = [], onClose, onSubmit, - dataTypes = ['INTEGER', 'BIGINT', 'VARCHAR', 'TEXT', 'BOOLEAN', 'TIMESTAMP', 'DATE', 'JSON', 'JSONB'], + dataTypes, }: ColumnDialogProps) { const [columnName, setColumnName] = useState(''); const [columnType, setColumnType] = useState('VARCHAR'); diff --git a/src/components/admin/CreateTableDialog.tsx b/src/components/admin/CreateTableDialog.tsx index 45dc4da..a5e31ce 100644 --- a/src/components/admin/CreateTableDialog.tsx +++ b/src/components/admin/CreateTableDialog.tsx @@ -31,14 +31,14 @@ type CreateTableDialogProps = { open: boolean; onClose: () => void; onCreate: (tableName: string, columns: Column[]) => Promise; - dataTypes?: string[]; + dataTypes: string[]; }; export default function CreateTableDialog({ open, onClose, onCreate, - dataTypes = ['INTEGER', 'BIGINT', 'SERIAL', 'VARCHAR', 'TEXT', 'BOOLEAN', 'TIMESTAMP', 'DATE', 'JSON', 'JSONB'], + dataTypes, }: CreateTableDialogProps) { const [tableName, setTableName] = useState(''); const [columns, setColumns] = useState([