diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-09 11:02:15 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:06:00 +0200 |
| commit | 540bb00a64e4704a0c08459af2b158bdafd59a60 (patch) | |
| tree | ab0eb0a35b1b092236af16adee9c139a5ae5d645 /src/actions/topology/machine.js | |
| parent | de24c69fe44df73c355a3ec481c7f146778cb4a6 (diff) | |
Move control of post-saga actions back to sagas
Diffstat (limited to 'src/actions/topology/machine.js')
| -rw-r--r-- | src/actions/topology/machine.js | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/actions/topology/machine.js b/src/actions/topology/machine.js index e11c7d1d..48d88052 100644 --- a/src/actions/topology/machine.js +++ b/src/actions/topology/machine.js @@ -1,6 +1,3 @@ -import {goDownOneInteractionLevel} from "../interaction-level"; -import {addPropToStoreObject} from "../objects"; - export const DELETE_MACHINE = "DELETE_MACHINE"; export const ADD_UNIT = "ADD_UNIT"; export const DELETE_UNIT = "DELETE_UNIT"; @@ -11,17 +8,6 @@ export function deleteMachine() { }; } -export function deleteMachineSucceeded() { - return (dispatch, getState) => { - const {interactionLevel, objects} = getState(); - const rack = objects.rack[objects.tile[interactionLevel.tileId].objectId]; - const machineIds = [...rack.machineIds]; - machineIds[interactionLevel.position - 1] = null; - dispatch(goDownOneInteractionLevel()); - dispatch(addPropToStoreObject("rack", rack.id, {machineIds})); - }; -} - export function addUnit(unitType, id) { return { type: ADD_UNIT, @@ -30,16 +16,6 @@ export function addUnit(unitType, id) { }; } -export function addUnitSucceeded(unitType, id) { - return (dispatch, getState) => { - const {objects, interactionLevel} = getState(); - const machine = objects.machine[objects.rack[objects.tile[interactionLevel.tileId].objectId] - .machineIds[interactionLevel.position - 1]]; - const units = [...machine[unitType + "Ids"], id]; - dispatch(addPropToStoreObject("machine", machine.id, {[unitType + "Ids"]: units})); - }; -} - export function deleteUnit(unitType, index) { return { type: DELETE_UNIT, @@ -47,14 +23,3 @@ export function deleteUnit(unitType, index) { index }; } - -export function deleteUnitSucceeded(unitType, index) { - return (dispatch, getState) => { - const {objects, interactionLevel} = getState(); - const machine = objects.machine[objects.rack[objects.tile[interactionLevel.tileId].objectId] - .machineIds[interactionLevel.position - 1]]; - const unitIds = machine[unitType + "Ids"].slice(); - unitIds.splice(index, 1); - dispatch(addPropToStoreObject("machine", machine.id, {[unitType + "Ids"]: unitIds})); - }; -} |
