Get user profile by user_id
(user_id: str)
| 653 | |
| 654 | |
| 655 | def get_profile(user_id: str) -> Optional[Dict]: |
| 656 | """Get user profile by user_id""" |
| 657 | conn = get_connection() |
| 658 | cursor = conn.cursor() |
| 659 | cursor.execute(""" |
| 660 | SELECT profile_json FROM profiles WHERE user_id = ? |
| 661 | """, (user_id,)) |
| 662 | row = cursor.fetchone() |
| 663 | conn.close() |
| 664 | if row: |
| 665 | return json.loads(row["profile_json"]) |
| 666 | return None |
| 667 | |
| 668 | |
| 669 | def get_paper_by_arxiv_id(arxiv_id: str) -> Optional[Dict]: |