Replace req["user"] with req["userEntity"] in the user.controller.ts #545
Labels
complexity: moderate
Time needed to do this ticket will be moderate e.g. 1-2 days
help wanted
Extra attention is needed
javascript
Pull requests that update Javascript code
maintenance
Maintenance / chore work
priority: soon
Should be prioritized soon.
state: approved
Ready to go. Not blocked or pending.
Milestone
Overview
Take a read through the umbrella ticket. As a sub task to this ticket we want to phase out the use of
req["user"]
from the user.controller.ts. This most popular endpoint is GET/user/me
. For a short period this endpoint will be less performant as the endpoint will be getting the full user profile twice: once in the AuthGuard and once when we hit the service. However, this hopefully will be solved swiftly as the refactor proceeds.Action Items
user.getUserByFirebaseId
and call ituser.getUserProfile
.getUserByFirebaseId
will be refactored to only return the user and will be used by the FirebaseAuthguard. See detials blocked [ticket] (Refactor user fetching to remove unnessary joins #454). The difference between the two functions is that instead of using thefirebaseId
we can use theuserId
instead to get the user.user.getUserProfile
rather than returningreq["user"]
. You will need to pass itreq["userEntity"].id
.The text was updated successfully, but these errors were encountered: