Performance.js
918 Bytes
import { notifyError } from '../services/app.js';
import {policyList,performList} from '../services/performance';
import {Toast} from "antd-mobile"
export default {
namespace: 'Performance',
state: {
item: {},
},
effects: {
*policyList({ payload, callback ,error}, { call, put }) {
const { data } = yield call(policyList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
// notifyError(data.message);
}
},
*performList({ payload, callback, error}, { call, put }) {
const { data } = yield call(performList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error&& error(data)
}
},
},
reducers: {
saveUser(state, { payload }) {
return { ...state, item: payload };
},
},
subscriptions: {
},
};