Skip to content

Conversation

@sheida-shab
Copy link

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

PR Summary :
Add unfollow functionality and complete follow toggle flow

What was missing

Users could follow other users, but there was no way to unfollow them.
This made the follow system one-directional and limited user control
over their timeline content.

What was added

  • Added an unfollow data-layer function to remove follow relationships
  • Introduced a POST /unfollow endpoint protected by JWT
  • Extended the API service with an unfollowUser method
  • Updated the profile UI to support follow/unfollow toggling

Architectural notes

This application is state-driven:

  • UI does not directly mutate DOM elements
  • Follow/unfollow actions only trigger API calls
  • State updates after successful API responses
  • UI re-renders based on the updated state

This ensures consistency between backend data and frontend rendering.

Result

Users can now both follow and unfollow other users,
and the UI always reflects the current application state.

@sheida-shab sheida-shab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Legacy-Code The name of the module. labels Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Legacy-Code The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant