summaryrefslogtreecommitdiff
path: root/client/containers/taskForm.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-19 02:27:52 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-19 02:27:52 +0200
commit9c5b96aec109f7b37cb2c861525a084a65a817ea (patch)
tree3aa2f97b5134892a9f227c6c8fdc8cd778679771 /client/containers/taskForm.js
parent2f2c1ef4029dee17be0d16acdd60b7d1718d519f (diff)
adding tasks
Diffstat (limited to 'client/containers/taskForm.js')
-rw-r--r--client/containers/taskForm.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/client/containers/taskForm.js b/client/containers/taskForm.js
index 0e8aeac..9280ed3 100644
--- a/client/containers/taskForm.js
+++ b/client/containers/taskForm.js
@@ -1,15 +1,21 @@
import { connect } from 'react-redux'
-import { setContent, setStyle, setAlpha, createTask } from '../actions'
+import { setContent, setStyle, setAlpha, createTask, addTask } from '../actions'
import TaskFormView from '../components/Tasks/TaskFormView.jsx'
+import client from '../client'
const mapStateToProps = (state) => state.currentTask
-const mapDispatchToProps = {
- clearContent: () => setContent(null),
- clearStyle: () => setStyle(null),
- setAlpha: (alpha) => setAlpha(alpha),
- createTask: () => createTask(),
-}
+const mapDispatchToProps = (dispatch, ownProps) => ({
+ clearContent: () => dispatch(setContent(null)),
+ clearStyle: () => dispatch(setStyle(null)),
+ setAlpha: (alpha) => dispatch(setAlpha(alpha)),
+ createTask: () => dispatch(createTask( (t) => {
+ console.log(client.task)
+ client.task.show(t.id).then( (task) => {
+ dispatch(addTask(task))
+ })
+ })),
+})
const TaskForm = connect(
mapStateToProps,