mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ResponseOps][Rules] Fix bug saving actions when editing rules. (#187767)
## Summary Fix bug saving actions when editing rules. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
66844f574f
commit
0b9751b245
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