feat(contacts): switch contacts UX to email-first flow
Some checks failed
CI / test (push) Failing after 18s
Some checks failed
CI / test (push) Failing after 18s
- expose email in user search/contact responses - add add-contact-by-email API endpoint - show email in contacts/search and add contact form by email in Contacts tab
This commit is contained in:
@@ -43,7 +43,12 @@ async def search_users_by_username(
|
||||
exclude_user_id: int | None = None,
|
||||
) -> list[User]:
|
||||
normalized = query.lower().strip().lstrip("@")
|
||||
stmt = select(User).where(func.lower(User.username).like(f"%{normalized}%"))
|
||||
stmt = select(User).where(
|
||||
or_(
|
||||
func.lower(User.username).like(f"%{normalized}%"),
|
||||
func.lower(User.email).like(f"%{normalized}%"),
|
||||
)
|
||||
)
|
||||
if exclude_user_id is not None:
|
||||
stmt = stmt.where(User.id != exclude_user_id)
|
||||
stmt = stmt.order_by(User.username.asc()).limit(limit)
|
||||
|
||||
Reference in New Issue
Block a user