-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: Implement rename organization #2634
Conversation
👇 Click on the image for a new way to code review
Legend |
b58bace
to
22f4c49
Compare
22f4c49
to
d485e76
Compare
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.
Looks great! Added a few small comments here let me know what you think
@IsDefined() | ||
public readonly id: string; | ||
|
||
name: string; |
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.
@Abobos due you think we should add here some maxLen for the organization name? Would use something permissive here, but maybe providing some limit will be a good idea to not break UI and etc...
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.
Could you throw more perspective?.. How would this break the UI if we don't limit it?
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.
For example everywhere we show the organization name it can overflow (the settings dropdown, organization select) and maybe other places. This is quite and edge case to be honest. Really not a must.
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.
@scopsy yes. this makes sense. done
@@ -154,4 +157,15 @@ export class OrganizationController { | |||
}) | |||
); | |||
} | |||
|
|||
@Put('/') |
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.
Can we add the member role enum here:
@Roles(MemberRoleEnum.ADMIN)
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.
Yes. we want to restrict the update to only members of an organisation with role admin
?
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.
Yes exactly 🙏
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.
@scopsy done
- Add update organization usecase, command - Create a PUT endpoint to /organizations - Add e2e test for updating the organization name
d485e76
to
a5ada4e
Compare
- Restrict organization update to admin only - Add a max length to the name field
a5ada4e
to
b9370b6
Compare
- Change method name - Change HTTP verb from PUT to PATCH
9355ebe
to
60eb79a
Compare
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.
🚀
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.
🌟
@IsDefined() | ||
public readonly id: string; | ||
|
||
@MaxLength(50) |
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.
Just noticed this. I think it is better to not limit the max length because in the creation of organization we don't limit the length and it would be a misalignment. It is a good thing to have done that, but for now we can skip it until we commit to a decision to limit org name and implement it everywhere, also at database level. 👍
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.
I tend to aggree that it should be better implemented across the board, was initially thinking we can only implement it here. Let me revert that rule
What change does this PR introduce?
This PR introduce an endpoint to update the name of an organization
Why was this change needed?
It is the API endpoint needed to implement Rename Organization
Other information (Screenshots)