import React, { Component } from 'react' import { Link } from 'react-router-dom' import { connect } from 'react-redux' import { history } from '../../../store' import actions from '../../../actions' import GraphForm from '../components/graph.form' class GraphNew extends Component { handleSubmit(data) { console.log(data) actions.graph.create(data) .then(res => { console.log(res) if (res.res && res.res.id) { history.push('/' + res.res.path) } }) .catch(err => { console.error('error') }) } render() { return ( ) } } const mapStateToProps = state => ({ graph: state.graph, }) const mapDispatchToProps = dispatch => ({ // searchActions: bindActionCreators({ ...searchActions }, dispatch), }) export default connect(mapStateToProps, mapDispatchToProps)(GraphNew)