feat(contacts): add contacts module with backend APIs and web tab
Some checks failed
CI / test (push) Failing after 18s
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user