[ Fix : "Follow +" button in Tutorial View Implemented ] #1204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 usedaddUserFollower
andisUserFollower
actions for further basic use case.While fixing the getUserProfileData action, I came across
checkUserHandleExists
which was finding the handle incl_user_handle
collection but a collection like this is not implemented anywhere, so I changed it to check undercl_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 toMahendar's id
, then clicked on thefollow +
button and it stored the following and followers relation underuser_followers
collection.Codelabz.-.Google.Chrome.2024-02-16.21-40-58.mp4
Types of changes
Checklist: