2020-02-19 11:53:32 +01:00
|
|
|
import {
|
|
|
|
PROJECT_USER_LIST_SUCCESS,
|
|
|
|
PROJECT_USER_LIST_FAILURE
|
2020-03-09 14:49:56 +01:00
|
|
|
} from '../actions/project';
|
2020-02-19 11:53:32 +01:00
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
items: []
|
2020-03-09 14:49:56 +01:00
|
|
|
};
|
2020-02-19 11:53:32 +01:00
|
|
|
|
|
|
|
export default (state = initialState, action) => {
|
|
|
|
|
2020-03-09 14:49:56 +01:00
|
|
|
console.log(`Action: ${JSON.stringify(action)}`);
|
2020-02-19 11:53:32 +01:00
|
|
|
|
|
|
|
switch (action.type) {
|
|
|
|
|
|
|
|
case PROJECT_USER_LIST_SUCCESS:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
items: action.projects
|
2020-03-09 14:49:56 +01:00
|
|
|
};
|
2020-02-19 11:53:32 +01:00
|
|
|
case PROJECT_USER_LIST_FAILURE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
items: [],
|
|
|
|
error: action.error
|
2020-03-09 14:49:56 +01:00
|
|
|
};
|
2020-02-19 11:53:32 +01:00
|
|
|
|
|
|
|
}
|
2020-03-09 14:49:56 +01:00
|
|
|
return state;
|
2020-02-19 11:53:32 +01:00
|
|
|
|
2020-03-09 14:49:56 +01:00
|
|
|
};
|