mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix bug saving actions
when editing rules. (#187764)
## Summary Fixes a bug that deleted rule actions when editing a rule.
This commit is contained in:
parent
e6f17e7c06
commit
3437c233fd
2 changed files with 5 additions and 9 deletions
|
@ -114,13 +114,9 @@ describe('updateRule', () => {
|
|||
},
|
||||
],
|
||||
});
|
||||
expect(http.put.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"/api/alerting/rule/12%2F3",
|
||||
Object {
|
||||
"body": "{\\"name\\":\\"test\\",\\"tags\\":[\\"foo\\"],\\"schedule\\":{\\"interval\\":\\"1m\\"},\\"params\\":{},\\"actions\\":[],\\"alert_delay\\":{\\"active\\":10}}",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(http.put).toHaveBeenCalledWith('/api/alerting/rule/12%2F3', {
|
||||
body: '{"name":"test","tags":["foo"],"schedule":{"interval":"1m"},"params":{},"actions":[{"group":"default","id":"2","params":{},"frequency":{"notify_when":"onActionGroupChange","throttle":null,"summary":false},"use_alert_data_for_template":false},{"id":".test-system-action","params":{}}],"alert_delay":{"active":10}}',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -44,7 +44,7 @@ export async function updateRule({
|
|||
const res = await http.put<AsApiContract<Rule>>(
|
||||
`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}`,
|
||||
{
|
||||
body: JSON.stringify(transformUpdateRuleBody(pick(rule, UPDATE_FIELDS))),
|
||||
body: JSON.stringify(transformUpdateRuleBody(pick(rule, UPDATE_FIELDS_WITH_ACTIONS))),
|
||||
}
|
||||
);
|
||||
return transformRule(res);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue