Skip to content

Commit

Permalink
sort by downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeWL committed Nov 15, 2024
1 parent 82517a0 commit a0e9dee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/getGutendexSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export async function getGutendexSearch(search: string): Promise<BookDetail[]> {
})
)
.filter((book) => book.textUrl)
.sort((a, b) => b.downloadCount - a.downloadCount)

if (data.length > 0) {
return data
Expand Down

0 comments on commit a0e9dee

Please sign in to comment.