yapi/client/reducer/group/project.js
2017-07-18 22:08:01 +08:00

31 lines
553 B
JavaScript

import {
FETCH_PROJECT_LIST,
PROJECT_ADD,
PROJECT_DEL
} from '../../constants/action-types';
const initialState = {
projectList: [],
total: null
};
export default (state = initialState, action) => {
switch (action.type) {
case FETCH_PROJECT_LIST: {
return {
...state,
projectList: action.payload.data.data.list,
total: action.payload.data.data.total
};
}
case PROJECT_ADD: {
return state;
}
case PROJECT_DEL: {
return state;
}
default:
return state;
}
};