import * as service from '../services/PropertyManagementServices';

export default {
  namespace: 'PropertyManagement',
  state: {
    Data: null,
    CurData: '',
  },

  reducers: {
    returnData(state: {}, { Data }: any) {
      return { ...state, Data };
    },
    returnCurData(state: {}, { CurData }: any) {
      return { ...state, CurData };
    },
  },

  effects: {
    //获取物业费列表
    *get({ playload }: any, { call, put }: any) {
      console.log(playload);
      const resp = yield call(service.get, playload);
      console.log(resp);
      let Data = resp.data;
      yield put({ type: 'returnData', Data });
    },
    *getById({ playload }: any, { call, put }: any) {
      let CurData = playload;
      yield put({ type: 'returnCurData', CurData });
    },
  },
};
