Refine Json for getLinks
This commit is contained in:
7
main.py
7
main.py
@@ -145,7 +145,12 @@ async def fastapi_get_links(network: str):
|
||||
async def fastapi_get_link_nodes(network: str, link: str):
|
||||
result = get_link_nodes(network, link)
|
||||
|
||||
return [result.value.from_node, result.value.to_node]
|
||||
return JSONResponse(
|
||||
status_code = status.HTTP_200_OK,
|
||||
content={
|
||||
'start': result.value.from_node,
|
||||
'end': result.value.to_node
|
||||
})
|
||||
|
||||
@app.post("/addlink/")
|
||||
async def fastapi_add_link(network: str, link: str, fromNode: str, toNode: str):
|
||||
|
||||
Reference in New Issue
Block a user