Commit bdc92d5c authored by 何乐's avatar 何乐 Committed by 陈帅

enhance TableList: auto search after editing (#3380)

parent acd67d21
......@@ -122,14 +122,7 @@ function postRule(req, res, u, b) {
break;
}
const result = {
list: tableListDataSource,
pagination: {
total: tableListDataSource.length,
},
};
return res.json(result);
return getRule(req, res, u);
}
export default {
......
......@@ -483,13 +483,17 @@ class TableList extends PureComponent {
handleUpdate = fields => {
const { dispatch } = this.props;
const { formValues } = this.state;
dispatch({
type: 'rule/update',
payload: {
query: formValues,
body: {
name: fields.name,
desc: fields.desc,
key: fields.key,
},
},
});
message.success('配置成功');
......
......@@ -33,11 +33,11 @@ export async function addRule(params) {
});
}
export async function updateRule(params) {
return request('/api/rule', {
export async function updateRule(params = {}) {
return request(`/api/rule?${stringify(params.query)}`, {
method: 'POST',
body: {
...params,
...params.body,
method: 'update',
},
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment