Skip to content
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

feat(#8986): Look up a single user from their username #8959

Closed

Conversation

m5r
Copy link
Member

@m5r m5r commented Mar 21, 2024

Description

#8877
Adds a new route GET /api/v2/users/:username to get a single user. Regular users can only query themselves, users with the can_view_users permission can query anyone.

Code review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

};
}

const body = await users.getUser(username);
Copy link
Member

@kennsippell kennsippell Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be working fine but my feedback is that since we are looking up one user, the successful response should maybe not be an array with 1 element but rather just the single result directly.

@m5r m5r changed the title feat(#8877): Look up a single user from their username feat(#8986): Look up a single user from their username Apr 4, 2024
@m5r m5r force-pushed the 8877-lookup-single-user-by-username branch 2 times, most recently from e035a11 to 6f51da9 Compare April 4, 2024 14:54
@m5r m5r force-pushed the 8877-lookup-single-user-by-username branch from 6f51da9 to bc1d524 Compare April 16, 2024 09:57
@m5r m5r closed this Apr 17, 2024
@m5r
Copy link
Member Author

m5r commented Apr 17, 2024

Superseded by #9016, closing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants