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

Remove courses and sessions from userService.getUserProfile and refactor module imports #721

Open
6 tasks
kyleecodes opened this issue Dec 7, 2024 · 5 comments · May be fixed by #747
Open
6 tasks

Remove courses and sessions from userService.getUserProfile and refactor module imports #721

kyleecodes opened this issue Dec 7, 2024 · 5 comments · May be fixed by #747
Assignees
Labels
complexity: advanced Time needed to do this ticket will be large e.g. 2-3+ days help-wanted Extra attention is needed refactor state: blocked Task is blocked.
Milestone

Comments

@kyleecodes
Copy link
Member

Overview

After implementing the new /courses_user endpoint (Issue #720 ) and updating the frontend to use it (frontend Issue #1223), we need to refactor the userService.getUserProfile function to no longer include courses and sessions data. This will reduce unnecessary data fetching and optimize the profile retrieval process. Additionally, we will need to clean up module imports to ensure that we aren't importing unnecessary modules or creating circular dependencies.

Blocked by #720 and this frontend issue: chaynHQ/bloom-frontend#1223

Action Items

  • Remove courses and sessions data from the userService.getUserProfile function to avoid pulling unnecessary data in user profile requests.
  • Refactor the service logic so that courses and sessions are no longer included by default when fetching the user profile.
  • Update module imports to prevent unnecessary circular dependencies and ensure the codebase remains modular.
  • Test the backend API to confirm that courses and sessions data are no longer being returned in the profile response.
  • Ensure that the new /courses_user endpoint is still functional and properly providing courses and sessions data for course and session pages.
  • Ensure no regressions occur in the application and that no unnecessary data is fetched when loading the user profile.

Resources

@kyleecodes kyleecodes added complexity: advanced Time needed to do this ticket will be large e.g. 2-3+ days help-wanted Extra attention is needed refactor state: blocked Task is blocked. labels Dec 7, 2024
@kyleecodes kyleecodes added this to the 02. Roadmaps milestone Dec 7, 2024
@kyleecodes kyleecodes changed the title Remove courses and sessions from userService.getUserProfile Remove courses and sessions from userService.getUserProfile and refactor module imports Dec 7, 2024
@csehatt741
Copy link

@kyleecodes, I`m happy to help here and create a draft PR until dependencies are fixed.

Copy link

github-actions bot commented Jan 4, 2025

Thank you @csehatt741 you have been assigned this issue!
Please follow the directions in our Contributing Guide. We look forward to reviewing your pull request. ✨


Support Chayn's mission? ⭐ Please star this repo to help us find more contributors like you!
Learn more about our impact and sign-up for our volunteer programsto join our mission!. 🌸

@csehatt741
Copy link

@kyleecodes, do you mean loading courses and sessions are optional or they should be removed from userService.getUserProfile completely?

  • optional: getUserProfile(id: string) -> getUserProfile(id: string, includeCourses: boolean = false)
  • removed: GetUserDto.courses can also be removed

@kyleecodes
Copy link
Member Author

@csehatt741 they can be removed completely. Anything else you notice can be removed, please make a note of it in here in issues / PR discussions. 👍 Thanks!

@csehatt741
Copy link

@kyleecodes, most of the modules directly register their dependencies, this way each module gets its own separate service instances.

Instead, encapsulating services inside their host modules and exporting them, we could ensure that the same instances of all the services are reused across all modules that import them.

If it is not the intended behavior, then it might be worth of refactoring and replacing direct registrations with module imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: advanced Time needed to do this ticket will be large e.g. 2-3+ days help-wanted Extra attention is needed refactor state: blocked Task is blocked.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants