updated service binders updated
This commit is contained in:
@@ -121,7 +121,19 @@ class EndpointResponse(BaseModel):
|
||||
@property
|
||||
def response(self):
|
||||
"""Convert response to dictionary format."""
|
||||
resutl_data = getattr(self.pagination_result, "data", None)
|
||||
result_data = getattr(self.pagination_result, "data", None)
|
||||
if not result_data:
|
||||
return {
|
||||
"completed": False,
|
||||
"message": "MSG0004-NODATA",
|
||||
"data": None,
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"size": 10,
|
||||
"total_count": 0,
|
||||
"total_pages": 0,
|
||||
},
|
||||
}
|
||||
result_pagination = getattr(self.pagination_result, "pagination", None)
|
||||
if not result_pagination:
|
||||
raise ValueError("Invalid pagination result pagination.")
|
||||
@@ -131,7 +143,7 @@ class EndpointResponse(BaseModel):
|
||||
return {
|
||||
"completed": self.completed,
|
||||
"message": self.message,
|
||||
"data": resutl_data,
|
||||
"data": result_data,
|
||||
"pagination": pagination_dict,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user