diff options
| -rw-r--r-- | frontend/src/actions/prefabs.js | 18 | ||||
| -rw-r--r-- | frontend/src/reducers/objects.js | 4 |
2 files changed, 7 insertions, 15 deletions
diff --git a/frontend/src/actions/prefabs.js b/frontend/src/actions/prefabs.js index 3f1558ce..8d262772 100644 --- a/frontend/src/actions/prefabs.js +++ b/frontend/src/actions/prefabs.js @@ -1,25 +1,13 @@ export const ADD_PREFAB = 'ADD_PREFAB' -export const ADD_PREFAB_SUCCEEDED = 'ADD_PREFAB_SUCCEEDED' export const DELETE_PREFAB = 'DELETE_PREFAB' export const DELETE_PREFAB_SUCCEEDED = 'DELETE_PREFAB_SUCCEEDED' export const OPEN_PREFAB_SUCCEEDED = 'OPEN_PREFAB_SUCCEEDED' - +//infer rackID from state in saga later export function addPrefab(name) { - return (dispatch, getState) => { - const { auth } = getState() - dispatch({ - type: ADD_PREFAB, - name, - userId: auth.userId, - }) - } -} - -export function addPrefabSucceeded(authorization) { return { - type: ADD_PREFAB_SUCCEEDED, - authorization, + type: ADD_PREFAB, + name, } } diff --git a/frontend/src/reducers/objects.js b/frontend/src/reducers/objects.js index b4db0a6b..dd2b61cb 100644 --- a/frontend/src/reducers/objects.js +++ b/frontend/src/reducers/objects.js @@ -1,3 +1,6 @@ +//TODO: add prefabs + + import { combineReducers } from 'redux' import { ADD_ID_TO_STORE_OBJECT_LIST_PROP, @@ -24,6 +27,7 @@ export const objects = combineReducers({ scheduler: object('scheduler'), portfolio: object('portfolio'), scenario: object('scenario'), + prefab: object('prefab'), }) function object(type, defaultState = {}) { |
