in packages/legacy/xconsole-model/src/model.js [34:66]
action: takeLatest(function* ({ payload, meta = {} }, { call, put }) {
try {
yield put({
type: 'save',
payload: { APIError: null },
})
const result = yield call(service, payload)
yield put({
type: 'save',
payload: {
Result: result,
},
})
if (meta.onCompleted) {
delay(() => {
meta.onCompleted(result)
}, 200)
}
} catch (error) {
yield put({
type: 'save',
payload: { APIError: error },
})
if (meta.onError) {
delay(() => {
meta.onError(error)
}, 200)
}
yield put({ type: '@@DVA_LOADING/HIDE', payload: { namespace, actionType: `${namespace}/action` } });
throw error;
}
}),