mirror of
https://github.com/johndoe6345789/postgres.git
synced 2026-04-24 13:55:00 +00:00
Fix: Remove hardcoded dataTypes defaults, make them required props from config
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -22,7 +22,7 @@ type ColumnDialogProps = {
|
||||
columns?: Array<{ column_name: string }>;
|
||||
onClose: () => void;
|
||||
onSubmit: (data: any) => Promise<void>;
|
||||
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');
|
||||
|
||||
@@ -31,14 +31,14 @@ type CreateTableDialogProps = {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
onCreate: (tableName: string, columns: Column[]) => Promise<void>;
|
||||
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<Column[]>([
|
||||
|
||||
Reference in New Issue
Block a user