summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/timestamp/containers/timestamp.new.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-27 17:03:30 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-27 17:03:30 +0200
commitd192242065ee35ca922c1433a5ea5eb83422261c (patch)
tree4fccba2be155d85efd58e7b41cee9cc705ea2955 /animism-align/frontend/views/timestamp/containers/timestamp.new.js
parent9beb386885dabad504235e446e7b301829c04265 (diff)
building...
Diffstat (limited to 'animism-align/frontend/views/timestamp/containers/timestamp.new.js')
-rw-r--r--animism-align/frontend/views/timestamp/containers/timestamp.new.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/animism-align/frontend/views/timestamp/containers/timestamp.new.js b/animism-align/frontend/views/timestamp/containers/timestamp.new.js
new file mode 100644
index 0000000..be96bf5
--- /dev/null
+++ b/animism-align/frontend/views/timestamp/containers/timestamp.new.js
@@ -0,0 +1,44 @@
+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 (
+ <GraphForm
+ isNew
+ data={{}}
+ onSubmit={this.handleSubmit.bind(this)}
+ />
+ )
+ }
+}
+
+const mapStateToProps = state => ({
+ graph: state.graph,
+})
+
+const mapDispatchToProps = dispatch => ({
+ // searchActions: bindActionCreators({ ...searchActions }, dispatch),
+})
+
+export default connect(mapStateToProps, mapDispatchToProps)(GraphNew)