Oscorp-HQ / quash-max

Quash: All-in-one bug reporting for mobile apps. Capture crashes, replays, and logs with shake-to-report. Auto-collect vital data, integrate with popular tools. Built by devs, for devs. Boost app quality and streamline debugging.
https://quashbugs.com
MIT License
33 stars 7 forks source link

Reduce Redundant Code #19

Open Hemanthr1 opened 3 months ago

Hemanthr1 commented 3 months ago

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 commented 2 months ago

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 commented 2 months ago

@dhairya-quash Provide any guidance needed

JishnuGoyal commented 2 months ago

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