-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bugfix/dp 765 check person not already part of org #826
Bugfix/dp 765 check person not already part of org #826
Conversation
Frontend/CO.CDP.OrganisationApp/Pages/Registration/JoinOrganisation.cshtml.cs
Show resolved
Hide resolved
…github.com:cabinetoffice/GCGS-Central-Digital-Platform into bugfix/DP-765-check-person-not-already-part-of-org
{ | ||
throw new PersonAlreadyAddedToOrganisationException( | ||
$"Person {command.createOrganisationJoinRequestCommand.PersonId} already added to organisation {command.organisationId}."); | ||
} |
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.
All these added lines seem to belong together. They accomplish one thing - guard that the person isn't already added. Why not replace all these lines with a single async GuardPersonIsNotAlreadyAdded(organisation, person)
?
CheckPersonAlreadyAdded
could be just renamed to GuardPersonIsNotAlreadyAdded
and throw exception instead of returning a bool.
Outcome: less code, and code in the public method remains on the same level of abstraction.
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.
@jakzal Thanks for the feedback. Done 👍
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.
@dbgoaco Did you rebuild everything? |
No description provided.