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

Reduce Redundant Code #19

Open
Hemanthr1 opened this issue Jul 19, 2024 · 3 comments
Open

Reduce Redundant Code #19

Hemanthr1 opened this issue Jul 19, 2024 · 3 comments

Comments

@Hemanthr1
Copy link
Member

Issue Description

Refactor the convertToOrgMemberDTO() method in both DashboardService and TeamMemberController to eliminate redundant code.

Expected Behavior

The implementation should be streamlined to avoid code duplication, enhancing maintainability.

Actual Behavior

Currently, the same convertToOrgMemberDTO() method is implemented in multiple places, leading to redundancy

@JishnuGoyal
Copy link
Contributor

Hi, I would like to discuss my approach on this issue:
Create a new service/utility class to where this convertToOrgMemberDTO() function can be extracted. Since these functions are identical in both classes, extraction is straightforward.
Now we simply call the extracted function from both these classes.

However, if this approach creates a mismatch with the codebase's style, let me know if I should go with another approach.
Kindly assign this to me :)

@Hemanthr1
Copy link
Member Author

@dhairya-quash Provide any guidance needed

@JishnuGoyal
Copy link
Contributor

@Hemanthr1 ill create a new class and name this function to a common logic one and use it in both classes.

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

No branches or pull requests

2 participants