Skip to content

Remove AcceptOrgUserByOrgId from AcceptOrgUserCommand to simplify interface#62

Open
lizard-boy wants to merge 2 commits into
mainfrom
remove-accept-org-user-method
Open

Remove AcceptOrgUserByOrgId from AcceptOrgUserCommand to simplify interface#62
lizard-boy wants to merge 2 commits into
mainfrom
remove-accept-org-user-method

Conversation

@lizard-boy

@lizard-boy lizard-boy commented Oct 19, 2024

Copy link
Copy Markdown

Type of change

- [ ] Bug fix
- [ ] New feature development
- [X] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

In researching a bug, I identified that there was the potential to remove one of the methods by which we accept a user into an org. We could simplify the interface and also avoid re-retrieving the OrganizationUser when we already have it in the calling method.

Code changes

  • file.ext: Description of what was changed and why

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

Greptile Summary

This pull request removes the AcceptOrgUserByOrgId method from the AcceptOrgUserCommand interface and updates related classes to simplify the codebase and avoid redundant data retrieval.

  • Removed AcceptOrgUserByOrgIdAsync method from src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IAcceptOrgUserCommand.cs
  • Updated src/Api/AdminConsole/Controllers/OrganizationUsersController.cs to use AcceptOrgUserAsync with orgUser object directly
  • Modified test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs to reflect new method signature
  • Deleted corresponding test cases in test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/AcceptOrgUserCommandTests.cs

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

5 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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