Skip to content

Commit 4193bfa

Browse files
committed
fix(tables): fix table creation form null values
1 parent f0f6d9b commit 4193bfa

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

src/pages/project/$db/components/AddTable.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { PureComponent } from 'react'
22
import PropTypes from 'prop-types'
33
import { withI18n, Trans } from '@lingui/react'
4-
import { Form, Modal, Input, Icon, Button, Select } from 'antd'
4+
import { Form, notification, Input, Icon, Button, Select } from 'antd'
55
import ColumnInput from './ColumnInput'
66

77
let id = 0
@@ -55,8 +55,8 @@ class DynamicAddTableForm extends React.Component {
5555
console.log('Merged values:', keys.map(key => columns[key]))
5656

5757
const table = values.table_name
58-
const names = values.columns.map(c => c.name)
59-
const types = values.columns.map(c => c.type)
58+
const names = values.columns.map(c => c.name).filter(i => i !== null)
59+
const types = values.columns.map(c => c.type).filter(i => i !== null)
6060

6161
// return
6262
const { data, success } = await this.props.createTable({
@@ -66,14 +66,9 @@ class DynamicAddTableForm extends React.Component {
6666
})
6767

6868
if (success) {
69-
Modal.success({
70-
title: i18n.t`Create Table Success!`,
71-
content: (
72-
<div>
73-
<div>{data.table} created</div>
74-
</div>
75-
),
76-
okText: i18n.t`好的`,
69+
notification.success({
70+
message: i18n.t`Create Table Success!`,
71+
description: `${data.table} created`,
7772
})
7873

7974
// reset form

0 commit comments

Comments
 (0)