List projet + list request

This commit is contained in:
Gael Peltey
2020-02-19 11:53:32 +01:00
parent da5583c797
commit a10297e22a
15 changed files with 414 additions and 14 deletions

View File

@ -0,0 +1,31 @@
import {
PROJECT_USER_LIST_SUCCESS,
PROJECT_USER_LIST_FAILURE
} from '../actions/project'
const initialState = {
items: []
}
export default (state = initialState, action) => {
console.log(`Action: ${JSON.stringify(action)}`)
switch (action.type) {
case PROJECT_USER_LIST_SUCCESS:
return {
...state,
items: action.projects
}
case PROJECT_USER_LIST_FAILURE:
return {
...state,
items: [],
error: action.error
}
}
return state
}