Remove id from item list (#146805)

## Remove id from item list when try to close alerts during update
exceptions
close: https://github.com/elastic/kibana/issues/146661

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Khristinin Nikita 2022-12-05 19:01:02 +01:00 committed by GitHub
parent 83657cd537
commit 7261175571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@
import React from 'react';
import type { EuiCommentProps } from '@elastic/eui';
import { EuiText, EuiAvatar } from '@elastic/eui';
import { capitalize } from 'lodash';
import { capitalize, omit } from 'lodash';
import moment from 'moment';
import type {
@ -143,11 +143,12 @@ export const prepareExceptionItemsForBulkClose = (
return exceptionItems.map((item: ExceptionListItemSchema) => {
if (item.entries !== undefined) {
const newEntries = item.entries.map((itemEntry: Entry | EntryNested) => {
const entry = omit(itemEntry, 'id') as Entry | EntryNested;
return {
...itemEntry,
field: itemEntry.field.startsWith('event.')
? itemEntry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`)
: itemEntry.field,
...entry,
field: entry.field.startsWith('event.')
? entry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`)
: entry.field,
};
});
return {