Merge branch 'feature/endpoint-confirm' into feature/trade-documents

This commit is contained in:
Cayo Puigdefabregas 2021-06-17 13:30:56 +02:00
commit c08ccd8d34

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