show error information when write fails

pull/1537/head
Jade McGough 2017-05-24 04:04:25 -07:00
parent b65e940dd1
commit 1b2e35c9a4
1 changed files with 9 additions and 5 deletions

View File

@ -30,12 +30,16 @@ class WriteDataForm extends Component {
}
handleWrite() {
const {onClose, source, notify} = this.props
const {onClose, source, notify, errorThrown} = this.props
const {selectedDatabase} = this.state
writeData(source, selectedDatabase, this.editor.value).then(() => {
notify('success', 'Data was written successfully')
onClose()
})
writeData(source, selectedDatabase, this.editor.value)
.then(() => {
notify('success', 'Data was written successfully')
onClose()
})
.catch(response => {
errorThrown(response, response.data.error)
})
}
render() {