mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 06:42:45 +00:00
pagesize as input
This commit is contained in:
@@ -8,9 +8,10 @@ const archive = {
|
||||
findBrews : async (req, res, next)=>{
|
||||
try {
|
||||
const title = req.query.title || '';
|
||||
const page = parseInt(req.query.page) || 1;
|
||||
const page = Math.max(parseInt(req.query.page) || 1, 1);
|
||||
console.log('trying page ', page);
|
||||
const pageSize = 10; // Set a default page size
|
||||
const minPageSize = 6;
|
||||
const pageSize = Math.max(parseInt(req.query.size) || 10, minPageSize);
|
||||
const skip = (page - 1) * pageSize;
|
||||
|
||||
const titleQuery = {
|
||||
|
||||
Reference in New Issue
Block a user