const Model: ModelType = {
namespace: 'namesps',
state: {
data: {}
},
effects: {
*fetch({ payload, callback }, { call, put, select }) {
const res = yield call(queryApplyInvoiceInfo, payload);
if (!res || !res.data) return;
const total = yield select((state) => state.user.currentUser )
console.log(total);
yield put({
type: 'change',
payload: res
})
if (callback) callback();
}
},
reducers: {
change (state, { payload }) {
return {
data: (state && state.data) || {
list: [],
pagination: {}
}
}
}
}
};
export default Model;