allow empty data for paginate

This commit is contained in:
simon
2023-05-18 17:01:07 +07:00
parent 60f1809ed8
commit 918a04c502

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"}}]})