Repository navigation
fix: look users up by handle in the who-to-follow API - #1178
Conversation
The users table lost its username column when handles moved to profiles (#1157), but the who-to-follow API (#990) and the README tests (#886) were written against it: the dismiss route bound users by username, and the username filter of the suggestions validated and looked it up on users. They now go through the profile's handle, like the other API routes. The API keeps calling it username, as its user resources do.
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
| return [ | ||
| 'round' => ['nullable', 'integer', 'min:0'], | ||
| 'username' => ['nullable', 'string', 'exists:users,username'], | ||
| 'username' => ['nullable', 'string', Rule::exists('profiles', 'handle')->where('type', ProfileType::User->value)], |
There was a problem hiding this comment.
Do we keep username for BC in the API?
We renamed it to handle, but then API clients would need to update too.
Summary
productiontests fail: #990 (who to follow from the API) and #886 (GitHub README) were written againstusers.username, which #1157 dropped when handles moved to profiles.POST api/v1/users/{user}/dismissbound users byusername→ now{user:handle}, like the other API user routes.usernamefilter ofGETsuggested users validated and looked upusers.username→ nowprofiles.handle. The parameter keeps its name, as the API's user resources still call the handleusername.username→handle.Validation
tsc --noEmit: cleancomposer test:lint,composer test:type-coverage: passbun run test:unit: 190/190pest --parallel --ci --coverage --exactly=100.0: 4492/4492, 100% coverageLimitations
Pushed for speed before an independent review.