Repository navigation
Manchester | 26-SDC-Jun | Fithi Teklom | Sprint 2 | Unfollow - #309
Fithi-Teklom wants to merge 1 commit into
Conversation
takanocap
left a comment
There was a problem hiding this comment.
Well done this looks good just a few things to make better. A few things in addition to the inline comments.
- Please use a linter to format the codes
- Please add test coverage for the functions added
| if (followingList) { | ||
| followingList.innerHTML = ""; | ||
|
|
||
| for (const followedUsername of profileData.follows || []) { |
There was a problem hiding this comment.
This loop builds unfollow can this list represent another profile/user's followers? if yes, shouldthe buttons be rendered at all when viewing someone else's profile?
| unfollowButtonEl.setAttribute("data-username", profileData.username || ""); | ||
| unfollowButtonEl.hidden = profileData.is_self || !profileData.is_following; | ||
| unfollowButtonEl.addEventListener("click", handleUnfollow); | ||
| if (!isLoggedIn) { |
There was a problem hiding this comment.
what happens to "unfollowButtonEl" if user not loggedIn? it should be gated so its only visible when u log in as u have done for "followButtonEl"
| <ul data-who-to-follow></ul> | ||
| </div> | ||
| <div class="profile__following-list"> | ||
| <h4>People you follow</h4> |
There was a problem hiding this comment.
what will show as heading when the profileData belongs to someone else ?
| ) | ||
|
|
||
| @jwt_required() | ||
| def do_unfollow(): |
There was a problem hiding this comment.
Please verify logic with other_profile. is a current user able to view a profile and remove /unfollow followers of the profile ?
Self checklist
Task code
CYF-1172
Changelist
#Summary
-Added the ability to unfollow users.
##Changes
-Added a backend endpoint and frontend API for unfollowing.
-Added Follow/Unfollow buttons to user profiles.
-Added a People you follow list with Unfollow buttons.
###Testing
-Verified Follow and Unfollow work correctly.
-Confirmed changes persist after refreshing the page