diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-15 23:24:28 +0300 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:42 +0200 |
| commit | 91c8088e1d7def9242f60c708cd34f25dcb77d76 (patch) | |
| tree | b68065019692cea5cf6c3d14b811104aff2f0879 /src/reducers/projects.js | |
| parent | d7512ace72448242b392299cf459c9c72c8dbee5 (diff) | |
Connect to backend and fetch initial project data
Diffstat (limited to 'src/reducers/projects.js')
| -rw-r--r-- | src/reducers/projects.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/reducers/projects.js b/src/reducers/projects.js index b6450fd7..ba3c792d 100644 --- a/src/reducers/projects.js +++ b/src/reducers/projects.js @@ -5,9 +5,12 @@ import { OPEN_NEW_PROJECT_MODAL, SET_AUTH_VISIBILITY_FILTER } from "../actions/projects"; +import {FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED} from "../actions/users"; -export const authorizations = (state = [], action) => { +export function authorizationsOfCurrentUser(state = [], action) { switch (action.type) { + case FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED: + return action.authorizationsOfCurrentUser; case ADD_PROJECT: return [ ...state, @@ -22,9 +25,9 @@ export const authorizations = (state = [], action) => { default: return state; } -}; +} -export const newProjectModalVisible = (state = false, action) => { +export function newProjectModalVisible(state = false, action) { switch (action.type) { case OPEN_NEW_PROJECT_MODAL: return true; @@ -33,13 +36,13 @@ export const newProjectModalVisible = (state = false, action) => { default: return state; } -}; +} -export const authVisibilityFilter = (state = "SHOW_ALL", action) => { +export function authVisibilityFilter(state = "SHOW_ALL", action) { switch (action.type) { case SET_AUTH_VISIBILITY_FILTER: return action.filter; default: return state; } -}; +} |
