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

Create user session hook #730

Merged
merged 3 commits into from
Nov 17, 2023
Merged

Create user session hook #730

merged 3 commits into from
Nov 17, 2023

Conversation

negreirosleo
Copy link
Contributor

This PR creates the useGetCurrentUser hook, it returns the user data from the session. In the route we add the user data to the session and now it can be accessed at any client component trough this hook.

This merges the default user from session with the user data that we
fetch from the api
This hook gets the user from the session and returns it, this commit
replaces the prop drilling of userId that we had to directly call the
useGetCurrentUser where it is needed.
The moduleNameMapper was added to jest.config to be able to use
absolute imports with jest.mock()
Copy link
Collaborator

@dmtrek14 dmtrek14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for this addition.

@negreirosleo negreirosleo merged commit a9aa719 into main Nov 17, 2023
2 checks passed
@negreirosleo negreirosleo deleted the create-user-session-hook branch November 17, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants