diff options
| author | Zog | 2017-12-22 14:01:43 +0100 |
|---|---|---|
| committer | Zog | 2017-12-22 14:01:43 +0100 |
| commit | efabcb6c50b727b74513fcd14edc99e15c8b7c98 (patch) | |
| tree | c7c0692c4fe52833b57cb0d7642add1f3577204e /app/javascript/routes/reducers/stopPoints.js | |
| parent | f9978a2cde70f378ec1d8afa34f086ad78a0e1be (diff) | |
| download | chouette-core-efabcb6c50b727b74513fcd14edc99e15c8b7c98.tar.bz2 | |
And fix the code
Diffstat (limited to 'app/javascript/routes/reducers/stopPoints.js')
| -rw-r--r-- | app/javascript/routes/reducers/stopPoints.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/javascript/routes/reducers/stopPoints.js b/app/javascript/routes/reducers/stopPoints.js index eeec06327..0b42b504f 100644 --- a/app/javascript/routes/reducers/stopPoints.js +++ b/app/javascript/routes/reducers/stopPoints.js @@ -38,15 +38,15 @@ const stopPoints = (state = [], action) => { case 'MOVE_STOP_UP': return [ ...state.slice(0, action.index - 1), - _.assign({}, state[action.index], { stoppoint_id: state[action.index - 1].stoppoint_id }), - _.assign({}, state[action.index - 1], { stoppoint_id: state[action.index].stoppoint_id }), + _.assign({}, state[action.index], { index: action.index - 1 }), + _.assign({}, state[action.index - 1], { index: action.index }), ...state.slice(action.index + 1) ] case 'MOVE_STOP_DOWN': return [ ...state.slice(0, action.index), - _.assign({}, state[action.index + 1], { stoppoint_id: state[action.index].stoppoint_id }), - _.assign({}, state[action.index], { stoppoint_id: state[action.index + 1].stoppoint_id }), + _.assign({}, state[action.index + 1], { index: action.index }), + _.assign({}, state[action.index], { index: action.index + 1 }), ...state.slice(action.index + 2) ] case 'DELETE_STOP': @@ -141,4 +141,4 @@ const stopPoints = (state = [], action) => { } } -export default stopPoints
\ No newline at end of file +export default stopPoints |
