Skip to content

Commit

Permalink
remove forced limit of 20 on getAll* methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dethe committed Feb 27, 2018
1 parent ad8e492 commit c46e955
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/controllers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ router.get("/getAllForType", async function getAllForType(req, res) {
let page = Math.max(parseInt(req.query.page || 1), 1);
let offset = 0;
let response_limit = Number.MAX_SAFE_INTEGER;
if (
if (!req.query.response_limit) {
// do nothing, return everything
} else if (
req.query.response_limit &&
req.query.response_limit.toLowerCase() === "none"
) {
Expand All @@ -42,7 +44,7 @@ router.get("/getAllForType", async function getAllForType(req, res) {
}
const titlelist = await db.any(TITLES_FOR_THINGS, {
language: as.value(req.query.language || "en"),
limit: RESPONSE_LIMIT,
limit: response_limit,
offset: offset,
type: objType
});
Expand Down

0 comments on commit c46e955

Please sign in to comment.