From 285195bf72c788406829277c541d8ea2f535a74d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 22 Jun 2023 12:41:41 +1000 Subject: [PATCH] feat(api): add `get_board` route --- invokeai/app/api/routers/boards.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/invokeai/app/api/routers/boards.py b/invokeai/app/api/routers/boards.py index a6f226fef80..55cd7c8ca2c 100644 --- a/invokeai/app/api/routers/boards.py +++ b/invokeai/app/api/routers/boards.py @@ -30,6 +30,19 @@ async def create_board( raise HTTPException(status_code=500, detail="Failed to create board") +@boards_router.get("/{board_id}", operation_id="get_board", response_model=BoardDTO) +async def get_board( + board_id: str = Path(description="The id of board to get"), +) -> BoardDTO: + """Gets a board""" + + try: + result = ApiDependencies.invoker.services.boards.get_dto(board_id=board_id) + return result + except Exception as e: + raise HTTPException(status_code=404, detail="Board not found") + + @boards_router.patch( "/{board_id}", operation_id="update_board",