Skip to content

Commit

Permalink
fix filter sorting (json-schema-org#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarhkVoyd authored Sep 4, 2024
1 parent b4569b6 commit 700112d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pages/tools/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ export async function getStaticProps() {
return aIndex - bIndex;
});

(Object.keys(filterCriteria) as FilterCriteriaFields[]).forEach((key) => {
if (key !== 'drafts' && Array.isArray(filterCriteria[key])) {
(filterCriteria[key] as (string | number)[]).sort((a, b) =>
a.toString().localeCompare(b.toString()),
);
}
});

return {
props: {
toolingData,
Expand Down

0 comments on commit 700112d

Please sign in to comment.