Skip to content

Commit

Permalink
Sort products by name alphabetically (#1007)
Browse files Browse the repository at this point in the history
Co-authored-by: James Elson <james.elson@gov.bc.ca>
  • Loading branch information
ikethecoder and Elson9 committed Mar 6, 2024
1 parent 10fcc49 commit b42c6f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nextapp/pages/devportal/api-directory/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const ApiPage: React.FC<
</Box>
<Card heading="Products">
<Box bg="gray.100">
{data?.products?.map((p) => (
{data?.products?.sort((a,b) => (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0)).map((p) => (
<ApiProductItem
key={uid(p)}
data={p}
Expand Down

0 comments on commit b42c6f8

Please sign in to comment.