diff options
| author | Luc Donnet | 2018-01-03 11:57:42 +0100 |
|---|---|---|
| committer | Luc Donnet | 2018-01-03 11:57:42 +0100 |
| commit | 7cce4762c11e7d1e78433f6f88d2e12928c398dc (patch) | |
| tree | 3084d95692a70f9c5d5a842aae6f4ec0ea07a1c3 /app/javascript/routes/reducers/stopPoints.js | |
| parent | 6497b23e18385121974f6cbf56d48caf897e69b1 (diff) | |
| parent | 414d0f6c4dd992696354757c4ae700952a7e4dd9 (diff) | |
| download | chouette-core-7cce4762c11e7d1e78433f6f88d2e12928c398dc.tar.bz2 | |
Merge branch 'master' into 5024-prevent-duplicate-referentials-from-being-created-during-parallel-db-transactions--rb201711271659
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 |
