fix(backend): person overview reads live in their own module, no import cycle with read receipts

This commit is contained in:
hh committed 2026-10-19 02:57:49 +00:00
1 parent 1abb396c36
commit 0dd14c5d5e
4 files changed
+202 -200

No files matched your search

+4 -4
View File
@@ -4,7 +4,7 @@ import asyncpg
from dishka.integrations.fastapi import DishkaRoute, FromDishka
from fastapi import APIRouter, HTTPException, Query
from utils.read import peers
from utils.read import peers, people
from utils.read.models import (
PeerGroups,
PeerHistoryView,
@@ -47,18 +47,18 @@ async def peer_history(
async def peer_overview(
pool: FromDishka[asyncpg.Pool], peer_id: int, account_id: AccountId
) -> PeerOverview:
return await peers.get_overview(pool, account_id, peer_id)
return await people.get_overview(pool, account_id, peer_id)
@router.get("/peers/{peer_id}/groups")
async def peer_groups(
pool: FromDishka[asyncpg.Pool], peer_id: int, account_id: AccountId
) -> PeerGroups:
return await peers.get_groups(pool, account_id, peer_id)
return await people.get_groups(pool, account_id, peer_id)
@router.get("/chats/{chat_id}/changes")
async def chat_changes(
pool: FromDishka[asyncpg.Pool], chat_id: int, account_id: AccountId
) -> list[ProfileChange]:
return await peers.get_chat_changes(pool, account_id, chat_id)
return await people.get_chat_changes(pool, account_id, chat_id)