This commit is contained in:
Lex Berezhny 2020-08-10 14:10:15 -04:00
parent 67c5c192f3
commit 1228700487
2 changed files with 3 additions and 3 deletions

View file

@ -226,7 +226,7 @@ def protobuf_search_claims(**constraints) -> str:
def search_claims(**constraints) -> Tuple[List[Output], Optional[int], Optional[Censor]]:
total = None
if constraints.pop('include_totals', False):
if constraints.pop('include_total', False):
total = search_claim_count(**constraints)
constraints['offset'] = abs(constraints.get('offset', 0))
constraints['limit'] = min(abs(constraints.get('limit', 10)), 50)

View file

@ -1631,7 +1631,7 @@ class API:
page_size = min(abs(pagination['page_size'] or DEFAULT_PAGE_SIZE), 50)
claim_filter_dict.update({
'offset': page_size * (page_num - 1), 'limit': page_size,
'include_totals': pagination['include_totals'],
'include_total': pagination['include_total'],
'order_by': order_by
})
if protobuf:
@ -1645,7 +1645,7 @@ class API:
"page": page_num,
"page_size": page_size
}
if pagination['include_totals']:
if pagination['include_total']:
d['total_pages'] = int((result.total + (page_size - 1)) / page_size)
d['total_items'] = result.total
return d