update BoardRecord

This commit is contained in:
chainchompa 2024-07-08 14:55:04 -04:00
parent 9ca6980c7a
commit 3a85ab15a1
4 changed files with 7 additions and 11 deletions

View File

@ -24,6 +24,8 @@ class BoardRecord(BaseModelExcludeNull):
"""The name of the cover image of the board."""
archived: bool = Field(description="Whether or not the board is archived.")
"""Whether or not the board is archived."""
is_private: Optional[bool] = Field(default=None, description="Whether the board is private.")
"""Whether the board is private."""
def deserialize_board_record(board_dict: dict) -> BoardRecord:
@ -38,6 +40,7 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord:
updated_at = board_dict.get("updated_at", get_iso_timestamp())
deleted_at = board_dict.get("deleted_at", get_iso_timestamp())
archived = board_dict.get("archived", False)
is_private = board_dict.get("is_private", False)
return BoardRecord(
board_id=board_id,
@ -47,6 +50,7 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord:
updated_at=updated_at,
deleted_at=deleted_at,
archived=archived,
is_private=is_private,
)

View File

@ -12,8 +12,6 @@ class BoardDTO(BoardRecord):
"""The URL of the thumbnail of the most recent image in the board."""
image_count: int = Field(description="The number of images in the board.")
"""The number of images in the board."""
is_private: Optional[bool] = Field(description="Whether the board is private.")
"""Whether the board is private."""
def board_record_to_dto(board_record: BoardRecord, cover_image_name: Optional[str], image_count: int) -> BoardDTO:

View File

@ -22,7 +22,7 @@ const overlayScrollbarsStyles: CSSProperties = {
width: '100%',
};
const BoardsListWithPrivate = () => {
const BoardsList = () => {
const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId);
const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText);
const allowPrivateBoards = useAppSelector((s) => s.config.allowPrivateBoards);
@ -127,4 +127,4 @@ const BoardsListWithPrivate = () => {
);
};
export default memo(BoardsListWithPrivate);
export default memo(BoardsList);

View File

@ -43,13 +43,7 @@ const ImageGalleryContent = () => {
>
{galleryHeader}
<Box>
<Flex alignItems="center" justifyContent="space-between" gap={2}>
<GalleryBoardName isOpen={isBoardListOpen} onToggle={onToggleBoardList} />
<GallerySettingsPopover />
</Flex>
<Box>
<BoardsList isOpen={isBoardListOpen} />
</Box>
<BoardsList isOpen={isBoardListOpen} />
</Box>
<Flex alignItems="center" justifyContent="space-between" gap={2}>
<Tabs index={galleryView === 'images' ? 0 : 1} variant="unstyled" size="sm" w="full">