summaryrefslogtreecommitdiff
path: root/frontend/views/index/containers
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/views/index/containers')
-rw-r--r--frontend/views/index/containers/graph.edit.js2
-rw-r--r--frontend/views/index/containers/graph.index.js16
-rw-r--r--frontend/views/index/containers/graph.new.js2
3 files changed, 16 insertions, 4 deletions
diff --git a/frontend/views/index/containers/graph.edit.js b/frontend/views/index/containers/graph.edit.js
index 2f8c7fb..fadcabc 100644
--- a/frontend/views/index/containers/graph.edit.js
+++ b/frontend/views/index/containers/graph.edit.js
@@ -19,7 +19,7 @@ class GraphEdit extends Component {
.then(response => {
// response
console.log(response)
- history.push('/graph/' + data.id + '/show/')
+ history.push('/' + data.path)
})
}
diff --git a/frontend/views/index/containers/graph.index.js b/frontend/views/index/containers/graph.index.js
index b18c768..7ac31da 100644
--- a/frontend/views/index/containers/graph.index.js
+++ b/frontend/views/index/containers/graph.index.js
@@ -3,11 +3,23 @@ import { Link } from 'react-router-dom'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
-// import actions from '../../actions'
+import { Loader } from '../../../common'
+import actions from '../../../actions'
// import * as uploadActions from './upload.actions'
class GraphIndex extends Component {
+ componentDidMount() {
+ actions.graph.index()
+ }
render() {
+ const { index } = this.props
+ if (index.loading) {
+ return (
+ <div className='graphIndex'>
+ <Loader />
+ </div>
+ )
+ }
return (
<div className='graphIndex'>
<b>welcome, swimmer</b>
@@ -18,7 +30,7 @@ class GraphIndex extends Component {
}
const mapStateToProps = state => ({
- // upload: state.upload,
+ index: state.graph.index,
})
const mapDispatchToProps = dispatch => ({
diff --git a/frontend/views/index/containers/graph.new.js b/frontend/views/index/containers/graph.new.js
index 186f8f7..be96bf5 100644
--- a/frontend/views/index/containers/graph.new.js
+++ b/frontend/views/index/containers/graph.new.js
@@ -14,7 +14,7 @@ class GraphNew extends Component {
.then(res => {
console.log(res)
if (res.res && res.res.id) {
- history.push('/graph/' + res.res.name)
+ history.push('/' + res.res.path)
}
})
.catch(err => {