Merge pull request #153 from eReuse/feature/endpoint-confirm

fixing bug 2281
This commit is contained in:
cayop 2021-06-16 17:08:21 +02:00 committed by GitHub
commit f5ff089929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class LotView(View):
query = self.visibility_filter(query) query = self.visibility_filter(query)
if args['search']: if args['search']:
query = query.filter(Lot.name.ilike(args['search'] + '%')) query = query.filter(Lot.name.ilike(args['search'] + '%'))
lots = query.paginate(per_page=6 if args['search'] else 30) lots = query.paginate(per_page=6 if args['search'] else query.count())
return things_response( return things_response(
self.schema.dump(lots.items, many=True, nested=2), self.schema.dump(lots.items, many=True, nested=2),
lots.page, lots.per_page, lots.total, lots.prev_num, lots.next_num lots.page, lots.per_page, lots.total, lots.prev_num, lots.next_num