feat: get projects endpoint
This commit is contained in:
@ -0,0 +1 @@
|
||||
from .project import ProjectRepository as ProjectRepository
|
||||
|
||||
14
repositories/project.py
Normal file
14
repositories/project.py
Normal file
@ -0,0 +1,14 @@
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from models.project import Project
|
||||
|
||||
|
||||
class ProjectRepository:
|
||||
def __init__(self, session: AsyncSession):
|
||||
self.session = session
|
||||
|
||||
async def get_all(self) -> list[Project]:
|
||||
stmt = select(Project).where(Project.is_deleted.is_(False))
|
||||
result = await self.session.execute(stmt)
|
||||
return list(result.scalars().all())
|
||||
Reference in New Issue
Block a user