Codelabz
Codelabz copied to clipboard
[ Fix : "Follow +" button in Tutorial View Implemented ]
Description
What was happening?
On clicking the follow +
button at '/tutorial/tutorial_id', it wasn't doing anything.
How solved it?
As soon as the page loads, fetched profile data of the current user and, using getUserProfileData
action which takes 'ID of the tutorial' as parameters populated the user field, then used addUserFollower
and isUserFollower
actions for further basic use case.
While fixing the getUserProfileData action, I came across checkUserHandleExists
which was finding the handle in cl_user_handle
collection but a collection like this is not implemented anywhere, so I changed it to check under cl_user
and instead of passing the created_by handle I am passing the uid of the user. And to get the uid of the user I stored it into the tutorials collection at the time of it's creation.
Related Issue
Fixes #1199
Motivation and Context
Dynamism
How Has This Been Tested?
Tested locally on my machine.
Video:
I created a tutorial by using codelabz user
ID and then switched to Mahendar's id
, then clicked on the follow +
button and it stored the following and followers relation under user_followers
collection.
https://github.com/scorelab/Codelabz/assets/123815256/9073d0fd-03ed-4bc2-abcc-9495511279f3
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.