feat: patch and get statuses endpoints

This commit is contained in:
2025-08-04 18:48:58 +04:00
parent 298e82d3d1
commit be1ea4009d
16 changed files with 146 additions and 15 deletions

View File

@ -1,5 +1,4 @@
from sqlalchemy import select
from sqlalchemy.orm import selectinload
from models import Board
from repositories.base import BaseRepository
@ -8,10 +7,8 @@ from schemas.board import UpdateBoardSchema
class BoardRepository(BaseRepository):
async def get_all(self, project_id: int) -> list[Board]:
stmt = (
select(Board)
.where(Board.is_deleted.is_(False), Board.project_id == project_id)
.options(selectinload(Board.statuses))
stmt = select(Board).where(
Board.is_deleted.is_(False), Board.project_id == project_id
)
result = await self.session.execute(stmt)
return list(result.scalars().all())