summaryrefslogtreecommitdiff
path: root/src/reducers/simulations.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-07 22:15:17 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:58 +0200
commit1b5d2658f9ec06308b2a5ed062f6f5b4798ed733 (patch)
tree84d35684a50f897fc4c5f460bed595adf22c9e66 /src/reducers/simulations.js
parent8218c3d3c21bfa7c4f3ee4872722b9b1261576fb (diff)
Reorganize actions and state tree
Diffstat (limited to 'src/reducers/simulations.js')
-rw-r--r--src/reducers/simulations.js33
1 files changed, 1 insertions, 32 deletions
diff --git a/src/reducers/simulations.js b/src/reducers/simulations.js
index 9bca7740..e15c2d21 100644
--- a/src/reducers/simulations.js
+++ b/src/reducers/simulations.js
@@ -1,35 +1,4 @@
-import {
- ADD_SIMULATION_SUCCEEDED,
- DELETE_SIMULATION_SUCCEEDED,
- OPEN_SIMULATION_SUCCEEDED,
- SET_AUTH_VISIBILITY_FILTER
-} from "../actions/simulations";
-import {FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED} from "../actions/users";
-
-export function authorizationsOfCurrentUser(state = [], action) {
- switch (action.type) {
- case FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED:
- return action.authorizationsOfCurrentUser;
- case ADD_SIMULATION_SUCCEEDED:
- return [
- ...state,
- action.authorization
- ];
- case DELETE_SIMULATION_SUCCEEDED:
- return state.filter(authorization => authorization[1] !== action.id);
- default:
- return state;
- }
-}
-
-export function authVisibilityFilter(state = "SHOW_ALL", action) {
- switch (action.type) {
- case SET_AUTH_VISIBILITY_FILTER:
- return action.filter;
- default:
- return state;
- }
-}
+import {OPEN_SIMULATION_SUCCEEDED} from "../actions/simulations";
export function currentSimulationId(state = -1, action) {
switch (action.type) {