allow empty data for paginate

This commit is contained in:
simon 2023-05-18 17:01:07 +07:00
parent 60f1809ed8
commit 918a04c502
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 3 additions and 0 deletions

View File

@ -127,6 +127,9 @@ class IndexPaginate:
def validate_data(self):
"""add pit and size to data"""
if not self.data:
self.data = {}
if "sort" not in self.data.keys():
self.data.update({"sort": [{"_doc": {"order": "desc"}}]})