summaryrefslogtreecommitdiff
path: root/client/reducers/currentTask.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-07 18:43:24 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-07 18:43:24 +0200
commitb89147ecd38b0f95a2e4917aba7f44bf3bb70327 (patch)
tree554d0d726755c89e55dbe79f0339cceb13543dd5 /client/reducers/currentTask.js
parentd520c67839724e80d8b68b8fe933f1e7755a8f42 (diff)
refactor audioplayer
Diffstat (limited to 'client/reducers/currentTask.js')
-rw-r--r--client/reducers/currentTask.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/client/reducers/currentTask.js b/client/reducers/currentTask.js
index 3f9233e..e760fba 100644
--- a/client/reducers/currentTask.js
+++ b/client/reducers/currentTask.js
@@ -2,7 +2,6 @@ import { addTask } from '../actions'
import client from '../client'
const currentTask = (state = {}, action) => {
- console.log(action.type)
switch (action.type) {
case 'SET_CONTENT':
return {
@@ -20,15 +19,18 @@ const currentTask = (state = {}, action) => {
alpha: action.alpha
}
case 'CREATE_TASK':
- client.task.create( state ).then( (data) => {
+ const record = {
+ content_file_id: state.content.id,
+ style_file_id: state.style.id,
+ alpha: state.alpha || '0.001',
+ command: 'nsatf.py',
+ completed: false,
+ }
+ client.task.create( record ).then( (data) => {
addTask( data )
})
- return {
- content: null,
- style: null,
- alpha: state.alpha,
- }
+ return state
// case 'ADD_TASK':
// return {
// ...state