feat(contacts): add contacts module with backend APIs and web tab
Some checks failed
CI / test (push) Failing after 18s

- add user_contacts table and migration

- expose /users/contacts list/add/remove endpoints

- add Contacts tab in chat list with add/remove actions
This commit is contained in:
2026-03-08 11:38:11 +03:00
parent 39b61ec94b
commit da73b79ee7
8 changed files with 261 additions and 26 deletions

View File

@@ -73,3 +73,17 @@ async def has_block_relation_between_users(db: AsyncSession, *, user_a_id: int,
async def list_blocked_users(db: AsyncSession, *, user_id: int) -> list[User]:
return await repository.list_blocked_users(db, user_id=user_id)
async def add_contact(db: AsyncSession, *, user_id: int, contact_user_id: int) -> None:
await repository.add_contact(db, user_id=user_id, contact_user_id=contact_user_id)
await db.commit()
async def remove_contact(db: AsyncSession, *, user_id: int, contact_user_id: int) -> None:
await repository.remove_contact(db, user_id=user_id, contact_user_id=contact_user_id)
await db.commit()
async def list_contacts(db: AsyncSession, *, user_id: int) -> list[User]:
return await repository.list_contacts(db, user_id=user_id)