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: add endpoint to get a user's own organization #3402

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Conversation

pdevine
Copy link
Contributor

@pdevine pdevine commented Oct 6, 2022

Summary

This change modifies the GET /api/organizations/:id endpoint to now support GET /api/organizations/self similar to how GET /api/identities/self works. The user does not need to be an infra support admin to retrieve their own organization details.

Additionally, the created and updated fields inside of the JSON response are now being properly updated (instead of returning null values), and a unit test for the endpoint has been added.

Checklist

  • Wrote appropriate unit tests
  • Considered security implications of the change
  • Updated associated docs where necessary
  • Updated associated configuration where necessary
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged
  • Considered data migrations for smooth upgrades

Copy link
Contributor

@ssoroka ssoroka left a comment

Choose a reason for hiding this comment

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

might be simpler to add organization id to the identity/self endpoint?

@pdevine
Copy link
Contributor Author

pdevine commented Oct 6, 2022

I did look at adding it to GET /api/users/self initially, but it seemed like more work since we'd still have to look up the org name, and then mutate the users API for each of the fields. This endpoint already had everything we needed, other than we were missing unit tests and the self ID.

@pdevine pdevine merged commit bac01df into main Oct 6, 2022
@pdevine pdevine deleted the get-orgs-self branch October 6, 2022 15:30
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.

4 participants