Skip to content

Commit

Permalink
search: result per page 50 -> 100 and make configurable (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Jun 27, 2024
1 parent 0ced193 commit 7629505
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions server/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ disableGUI: false
# You can disable searching through the GUI
disableSearchGUI: false

# How many max entries do you want per page?
search:
resultPerPage: 100

## Configure the GUI
html:
css:
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/html/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function shortURL(url, longVersion) {
}

search.get('/', async function (request, response) {
const limit = request.query.limit || 50;
const limit = request.query.limit || nconf.get('search:resultPerPage') || 100;
const currentPage = Number.parseInt(request.query.page, 10) || 1;
let result = await (request.query.search === '' ||
request.query.search === undefined
Expand Down

0 comments on commit 7629505

Please sign in to comment.