🎨 style(chat.py): add status code 201 to init_build endpoint

The init_build endpoint now returns a status code of 201 to indicate that a new resource has been created. This improves the consistency of the API and makes it easier for clients to understand the response.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-13 20:23:44 -03:00
commit 044b01e6ad

View file

@ -32,7 +32,7 @@ async def chat(client_id: str, websocket: WebSocket):
await websocket.close(code=status.WS_1011_INTERNAL_ERROR, reason=str(exc))
@router.post("/build/init", response_model=InitResponse)
@router.post("/build/init", response_model=InitResponse, status_code=201)
async def init_build(graph_data: dict):
"""Initialize the build by storing graph data and returning a unique session ID."""