90% сеньоров плачат на таких коммитах
This commit is contained in:
@@ -21,17 +21,20 @@ async def get_views_history(self: 'Usecase', input: dto.GetViewsHistoryInput) ->
|
||||
|
||||
context.ensure_project_permission(domain.PermissionKey.PLACEMENTS_READ, placement.project_id)
|
||||
|
||||
if not placement.post:
|
||||
return dto.GetViewsHistoryOutput(histories=[])
|
||||
|
||||
histories = await self.database.get_views_history(
|
||||
input.placement_id,
|
||||
placement.post.id,
|
||||
from_date=input.from_date,
|
||||
to_date=input.to_date,
|
||||
)
|
||||
|
||||
return dto.GetViewsHistoryOutput(
|
||||
histories=[
|
||||
dto.PlacementViewsHistoryOutput(
|
||||
dto.PostViewsHistoryOutput(
|
||||
id=history.id,
|
||||
placement_id=history.placement_id,
|
||||
post_id=history.post_id,
|
||||
views_count=history.views_count,
|
||||
fetched_at=history.fetched_at,
|
||||
created_at=history.created_at,
|
||||
|
||||
Reference in New Issue
Block a user