mirror of
https://github.com/shadoll/scatcher.git
synced 2025-12-20 01:25:59 +00:00
Fix formatting issues in history_controller.py and manager/history.py, and update default values in request_data.py
This commit is contained in:
@@ -37,7 +37,7 @@ class HistoryController(BaseController):
|
|||||||
status=Status.error,
|
status=Status.error,
|
||||||
message="No requests found.",
|
message="No requests found.",
|
||||||
)
|
)
|
||||||
return [RequestData(**d) for d in items ]
|
return [RequestData(**d) for d in items]
|
||||||
|
|
||||||
async def last_requests(
|
async def last_requests(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ class History:
|
|||||||
if len(self.data) == 0:
|
if len(self.data) == 0:
|
||||||
return None
|
return None
|
||||||
for item in self.data:
|
for item in self.data:
|
||||||
if "method" in item:
|
if "method" in item:
|
||||||
item["method"] = Methods(item["method"])
|
item["method"] = Methods(item["method"])
|
||||||
return self.data
|
return self.data
|
||||||
|
|
||||||
def get(self, index: int) -> dict | None:
|
def get(self, index: int) -> dict | None:
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ from schema.methods import Methods
|
|||||||
|
|
||||||
class RequestData(BaseModel):
|
class RequestData(BaseModel):
|
||||||
method: Methods = Methods.GET
|
method: Methods = Methods.GET
|
||||||
data: dict = {}
|
data: dict|None = None
|
||||||
params: dict = {}
|
params: dict = {}
|
||||||
form: dict = {}
|
form: dict|None = None
|
||||||
url: str
|
url: str
|
||||||
headers: dict = {}
|
headers: dict = {}
|
||||||
cookies: dict = {}
|
cookies: dict = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user