This commit is contained in:
parent
6cf319940f
commit
f9964a8157
@ -48,12 +48,12 @@ class ProxyCreateLink(pydantic.BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class ProxyRequest(pydantic.BaseModel):
|
class ProxyRequest(pydantic.BaseModel):
|
||||||
action: Literal["create-url", "read-config"]
|
action: Literal["create-urls", "read-config"]
|
||||||
urls: Optional[list[ProxyCreateLink]]
|
urls: Optional[list[ProxyCreateLink]]
|
||||||
|
|
||||||
|
|
||||||
class ProxyResponse(pydantic.BaseModel):
|
class ProxyResponse(pydantic.BaseModel):
|
||||||
action: Literal["create-url", "read-config"]
|
action: Literal["create-urls", "read-config"]
|
||||||
urls: Optional[list[pydantic.HttpUrl]]
|
urls: Optional[list[pydantic.HttpUrl]]
|
||||||
|
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ class ProxyElem:
|
|||||||
response_data: ProxyResponse
|
response_data: ProxyResponse
|
||||||
|
|
||||||
try:
|
try:
|
||||||
request_data = ProxyRequest.parse_obj({"urls": link_requests, "action": "create-url"})
|
request_data = ProxyRequest.parse_obj({"urls": link_requests, "action": "create-urls"})
|
||||||
except pydantic.ValidationError as e:
|
except pydantic.ValidationError as e:
|
||||||
logger.info(e)
|
logger.info(e)
|
||||||
return clean_urls
|
return clean_urls
|
||||||
|
Loading…
Reference in New Issue
Block a user