mirror of
https://github.com/shadoll/scatcher.git
synced 2025-12-20 03:26: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.",
|
message="No requests found.",
|
||||||
)
|
)
|
||||||
return RequestData(**item)
|
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(
|
async def last_requests(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user