mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
31 lines
553 B
JavaScript
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;
|
|
}
|
|
};
|