summaryrefslogtreecommitdiff
path: root/client/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'client/reducers')
-rw-r--r--client/reducers/currentTask.js8
-rw-r--r--client/reducers/tasks.js3
2 files changed, 5 insertions, 6 deletions
diff --git a/client/reducers/currentTask.js b/client/reducers/currentTask.js
index 126c35d..5f5fe52 100644
--- a/client/reducers/currentTask.js
+++ b/client/reducers/currentTask.js
@@ -26,10 +26,10 @@ const currentTask = (state = {}, action) => {
tool: 'nsatf',
completed: false,
}
- client.task.create( record ).then( (data) => {
- data.content_file = state.content
- data.style_file = state.file
- // store.dispatch( addTask( data ) )
+ client.task.create( record ).then( (task) => {
+ task.content_file = state.content
+ task.style_file = state.file
+ action.cb && action.cb(task)
})
return state
default:
diff --git a/client/reducers/tasks.js b/client/reducers/tasks.js
index 9edd82a..470c7a7 100644
--- a/client/reducers/tasks.js
+++ b/client/reducers/tasks.js
@@ -6,8 +6,7 @@ const tasks = (state = [], action) => {
case 'LOAD_TASKS':
return action.tasks
case 'ADD_TASK':
- console.log(action)
- return state.concat([action.task])
+ return [action.task].concat(state)
case 'TASK_UPDATED':
const updated_tasks = state.map(task => {
if (task.id == id) {