Skip to content

Commit

Permalink
[frontend] fix duplicates in Bulk Search (OpenCTI-Platform#7214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archidoit authored and dotdev8 committed Jul 8, 2024
1 parent b1ad074 commit ae9e011
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,7 @@ const SearchBulk = () => {
markings: resolvedStixCoreObject.objectMarking,
analyses: resolvedStixCoreObject.containersNumber.total,
created_at: resolvedStixCoreObject.created_at,
author: R.pathOr(
'-',
['createdBy', 'name'],
resolvedStixCoreObject,
),
author: resolvedStixCoreObject.createdBy?.name ?? '-',
creators: (resolvedStixCoreObject.creators ?? [])
.map((c) => c?.name)
.join(', '),
Expand All @@ -372,8 +368,9 @@ const SearchBulk = () => {
});
})
).flat();
const finalResult = R.uniqBy((o) => o.id, result);
setLoading(false);
setResolvedEntities(result);
setResolvedEntities(finalResult);
setPaginationOptions(searchPaginationOptions);
} else {
setResolvedEntities([]);
Expand Down

0 comments on commit ae9e011

Please sign in to comment.