FEAT: Users can now edit their own user bios

This commit is contained in:
JustIceO7
2025-03-05 02:54:50 +00:00
parent dd0a557612
commit 633776dfe9
3 changed files with 94 additions and 7 deletions

View File

@@ -27,6 +27,17 @@ def get_username(user_id: str) -> Optional[str]:
""", (user_id,))
return data['username'] if data else None
def update_bio(user_id: int, bio: str):
"""
Updates users bio given their user_id
"""
with Database() as db:
db.execute("""
UPDATE users
SET bio = ?
WHERE user_id = ?
""", (bio, user_id))
def get_session_info_email(email: str) -> dict:
"""
Returns username and user_id given email