Skip to content

Commit

Permalink
Remove id from item list (elastic#146805)
Browse files Browse the repository at this point in the history
## Remove id from item list when try to close alerts during update
exceptions
close: elastic#146661

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
nkhristinin and kibanamachine authored Dec 5, 2022
1 parent 83657cd commit 7261175
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7261175

Please sign in to comment.