blahosyl / task-manager-frontend

On Fire 🔥 - the cheerful productivity app | PP5 Code Institute
https://pp5-task-manager-frontend-eebb66e2c99d.herokuapp.com/
0 stars 2 forks source link

USER STORY: Watch/unwatch tasks #24

Closed blahosyl closed 1 month ago

blahosyl commented 1 month ago

As a Logged-in User,

I want to watch/unwatch tasks,

so that I can update which tasks appear in my Watched feed

Acceptance Criteria

  1. The TaskDetail page has a clickable "eye" icon, where users can watch/unwatch tasks
  2. The icon changes color depending on whether the Logged-in User already watches the post

Tasks

blahosyl commented 1 month ago

Getting a 400 error

Image

blahosyl commented 1 month ago

Unwatching works without issues, only watching is a problem.

blahosyl commented 1 month ago

I contacted tutoring reagarding the 400 issue with watching tasks.

After tutor Osisin showed me how I can see Django errors in the network tab of Chrome Dev tools, I discovered that the watcher endpoint was missing the watched:id.

Image

Changing {task: id} to {watched:id} in the API call in Task.js solved the issue (dbff1d1).