1234567891011121314151617181920212223242526272829 |
- import { queryProjectNotice } from '../services/api';
-
- export default {
- namespace: 'project',
-
- state: {
- notice: [],
- },
-
- effects: {
- *fetchNotice(_, { call, put }) {
- const response = yield call(queryProjectNotice);
- yield put({
- type: 'saveNotice',
- payload: Array.isArray(response) ? response : [],
- });
- },
- },
-
- reducers: {
- saveNotice(state, action) {
- return {
- ...state,
- notice: action.payload,
- };
- },
- },
- };
|