Skip to content

Commit

Permalink
Fix sort and unique operations in useDecoratedApplications
Browse files Browse the repository at this point in the history
Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 committed Jul 1, 2024
1 parent 5effadc commit 4c72fdd
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,18 @@ export const useDecoratedApplications = (
const referencedArchetypeRefs = useMemo(
() =>
unique(
applications
.flatMap((app) => app.archetypes)
.filter(Boolean)
.sort(universalComparator)
),
applications.flatMap((app) => app.archetypes).filter(Boolean),
({ id, name }) => `${id}:${name}`
).sort((a, b) => universalComparator(a.name, b.name)),
[applications]
);

const referencedBusinessServiceRefs = useMemo(
() =>
unique(
applications
.flatMap((app) => app.businessService)
.filter(Boolean)
.sort(universalComparator)
),
applications.flatMap((app) => app.businessService).filter(Boolean),
({ id, name }) => `${id}:${name}`
).sort((a, b) => universalComparator(a.name, b.name)),
[applications]
);

Expand Down

0 comments on commit 4c72fdd

Please sign in to comment.