Skip to content

Commit

Permalink
Merge pull request #1833 from folio-org/FOLIO-4165-search-endpoints-2
Browse files Browse the repository at this point in the history
FOLIO-4165 Sort endpoints results by path
  • Loading branch information
dcrossleyau authored Jan 21, 2025
2 parents d3f3667 + c4064de commit ee0994f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/search-endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ $( (searchEndpoints) => {
if ( results.length ) {
searchResults.empty();
hits.html( `Hits: ${ results.length }` );
results.forEach( ( result ) => {
const resultsSorted = results.sort(function(a, b) {
return a.path.localeCompare(b.path);
});
resultsSorted.forEach( ( result ) => {
if ( debug ) { console.log( `Result: ${ result.path }` ); }
const urlRepo = `${ urlRepoBase }${ result.moduleName }`;
const urlS3Repo = `${ urlS3Base }${ result.moduleName }`;
Expand Down

0 comments on commit ee0994f

Please sign in to comment.