model.ts 529 Bytes
Newer Older
1
import { queryAdvancedProfile } from './service';
2 3

export default {
4
  namespace: 'BLOCK_NAME_CAMEL_CASE',
5 6

  state: {
ddcat1115's avatar
ddcat1115 committed
7 8 9
    advancedOperation1: [],
    advancedOperation2: [],
    advancedOperation3: [],
10 11 12
  },

  effects: {
afc163's avatar
afc163 committed
13
    *fetchAdvanced(_, { call, put }) {
ddcat1115's avatar
ddcat1115 committed
14 15 16 17 18
      const response = yield call(queryAdvancedProfile);
      yield put({
        type: 'show',
        payload: response,
      });
19 20 21 22 23 24 25 26 27 28 29 30
    },
  },

  reducers: {
    show(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};