Skip to content

Manchester | 26-SDC-Jun | Fithi Teklom | Sprint 2 | Unfollow - #309

Open
Fithi-Teklom wants to merge 1 commit into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/unfollow
Open

Fithi-Teklom wants to merge 1 commit into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/unfollow

Conversation

@Fithi-Teklom

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

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

@Fithi-Teklom Fithi-Teklom added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 14, 2026
@takanocap takanocap self-assigned this Nov 3, 2026
@takanocap takanocap added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 3, 2026

@takanocap takanocap left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done this looks good just a few things to make better. A few things in addition to the inline comments.

  1. Please use a linter to format the codes
  2. Please add test coverage for the functions added

if (followingList) {
followingList.innerHTML = "";

for (const followedUsername of profileData.follows || []) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"

Comment thread front-end/index.html
<ul data-who-to-follow></ul>
</div>
<div class="profile__following-list">
<h4>People you follow</h4>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what will show as heading when the profileData belongs to someone else ?

Comment thread backend/endpoints.py
)

@jwt_required()
def do_unfollow():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please verify logic with other_profile. is a current user able to view a profile and remove /unfollow followers of the profile ?

@takanocap takanocap added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants