// import { goodsGetListDataAPI, goodsListConfig } from "../services/api";

export default {
  namespace: "goods",

  state: {
    loading: false,
    list: []
  },

  effects: {
    // *getListData({ payload }, { call, put }) {
    //   const response = yield call(goodsGetListDataAPI, payload);
    //   yield put({
    //     type: "goodsList",
    //     list: Array.isArray(response.data.content) ? response.data.content : [],
    //     pagination: response.pagination
    //   });
    // },
    // *getListConfig(_, { call, put }) {
    //   const response = yield call(goodsListConfig);
    //   yield put({
    //     type: "goodsListConfig",
    //     response
    //   });
    // }
  },

  reducers: {
    goodsList(state, payload) {
      return {
        ...state,
        list: payload.list,
        pagination: payload.pagination
      };
    },
    goodsListConfig(state, payload) {
      return {
        ...state,
        goodsListConfig: payload
      };
    }
  }
};
