feat: пагинация

This commit is contained in:
Artem Tsyrulnikov
2025-12-15 23:18:59 +03:00
parent 83a81f46f7
commit 2339471956
25 changed files with 151 additions and 121 deletions

View File

@@ -8,7 +8,7 @@ if TYPE_CHECKING:
async def get_workspace_projects(
self: 'Usecase', input: dto.GetWorkspaceProjectsInput
) -> dto.GetWorkspaceProjectsOutput:
) -> list[dto.ProjectOutput]:
context = await self.ensure_workspace_permission(
input.workspace_id, input.user_id, domain.PermissionKey.PROJECTS_READ
)
@@ -17,15 +17,13 @@ async def get_workspace_projects(
projects = await self.database.get_workspace_projects(input.workspace_id, allowed_project_ids=allowed_project_ids)
return dto.GetWorkspaceProjectsOutput(
projects=[
dto.ProjectOutput(
id=project.id,
telegram_id=project.channel.telegram_id,
title=project.channel.title,
username=project.channel.username,
status=project.status,
)
for project in projects
]
)
return [
dto.ProjectOutput(
id=project.id,
telegram_id=project.channel.telegram_id,
title=project.channel.title,
username=project.channel.username,
status=project.status,
)
for project in projects
]