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

in 'cli-chat' example cli-chat.controller-behaviors.chat/update-user! function assigns 'loggable-user' in the 'channels' atom under the ':user' key so 'loggable-user' doesn't replace 'guest' in the channel. #247

Open
enesj opened this issue Feb 11, 2023 · 0 comments

Comments

@enesj
Copy link

enesj commented Feb 11, 2023

When we call /me endpoint the response looks like this:

{:session-id #uuid "3dec53a7-0518-4912-b92a-7c5da257f5d4", :users/role :guest, :users/id #uuid "7701c8b3-2fe5-48ba-b428-954e59871544", :users/name "guest_OHAA", 
:user {:users/id 1, :users/name "enes", :users/role "member"}}

My suggestion is to change the (swap! channels update ch assoc :user loggable-user) in 'update-user!' to this:
(swap! channels update ch merge loggable-user) to resolve this problem.

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

No branches or pull requests

1 participant