(api) add option to board delete route and logic to services

This commit is contained in:
Mary Hipp
2023-06-26 15:53:21 -04:00
committed by psychedelicious
parent 8297b7e1ae
commit 73f2092ec5
4 changed files with 70 additions and 7 deletions

View File

@ -71,11 +71,19 @@ async def update_board(
@boards_router.delete("/{board_id}", operation_id="delete_board")
async def delete_board(
board_id: str = Path(description="The id of board to delete"),
include_images: bool = Path(
description="Permanently delete all images on the board", default=False
),
) -> None:
"""Deletes a board"""
try:
ApiDependencies.invoker.services.boards.delete(board_id=board_id)
if include_images:
ApiDependencies.invoker.services.images.delete_images_on_board(
board_id=board_id
)
else:
ApiDependencies.invoker.services.boards.delete(board_id=board_id)
except Exception as e:
# TODO: Does this need any exception handling at all?
pass