List projet + list request
This commit is contained in:
31
frontend/src/reducers/project.js
Normal file
31
frontend/src/reducers/project.js
Normal 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
|
||||
|
||||
}
|
Reference in New Issue
Block a user