-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add twitter_handle to profiles with case-insensitive uniqueness #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
joelamouche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good!
Please add a test to profile_tests.rs and also a script like scripts/test_projects.sh to easily test this without a frontend
| @@ -0,0 +1,122 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetching nonce for 0x6cfD0753EC4da15Dcb418E11e921C0665c1d1cBf...
Nonce response: {"nonce":3,"address":"0x6cfD0753EC4da15Dcb418E11e921C0665c1d1cBf"}
Signing nonce...
Fetching current profile...
GET profile HTTP 404:
Updating profile with twitter_handle: testhandle...
PUT profile HTTP 404:
❌ Unexpected status 404
Maybe there is something wrong with the url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script now handles the 404 case by automatically creating a profile first before attempting to update the twitter handle
Summary
Adds
twitter_handlefield to user profiles with case-insensitive uniqueness enforcement and format validation, following the same pattern asgithub_login.Closes #102
Changes
005_add_twitter_handle.sqlwith column and unique index onLOWER(twitter_handle)twitter_handlefield toProfileentity,UpdateProfileRequest, andProfileResponseDTOsfind_by_twitter_handlerepository method with case-insensitive lookuptwitter_handlein all GET profile responsesAPI Changes
PUT /profile
{ "twitter_handle": "tushar" // optional, 1-15 chars: a-zA-Z0-9_ }