mirror of
https://github.com/shadoll/scatcher.git
synced 2025-12-20 01:25:59 +00:00
Refactor history_controller.py to handle empty request history
This commit is contained in:
@@ -30,7 +30,14 @@ class HistoryController(BaseController):
|
||||
message="No requests found.",
|
||||
)
|
||||
return RequestData(**item)
|
||||
return [RequestData(**d) for d in history.all()]
|
||||
|
||||
items = history.all()
|
||||
if items is None:
|
||||
return Answer(
|
||||
status=Status.error,
|
||||
message="No requests found.",
|
||||
)
|
||||
return [RequestData(**d) for d in items ]
|
||||
|
||||
async def last_requests(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user