This is a short list of pointers related to this project:
While I’m not going to give any specific solutions, I thought that the challenges I had of completing this project were beyond the scope of what the course is trying to teach, and therefore not quite instructive, at least in terms pertaining the subject of this course.
Firstly, there are a few hindering bugs, at least in the version I completed 5/8/2021. These could possibly be intentional (debugging is a crucial skill after all), but I found them frustrating enough to want to at least point others in their direction.
Carefully inspect the code for the
loadCommentsForArticleIdasync thunk creator. For some reason, the code for the first few tasks of this project were pre-completed for me and there were two things I had to fix to make this function behave as expected. You’ll need to add one thing, and change one thing (again, at least as it was pre-written for me).
As is, the POST request to the articles API does not return a ‘proper’ comment response. I’ll leave the debugging to you, but remember that the project uses a Mock Service Worker, and you therefore have access to its logic in the project files. Dig around; one small edit to a single file will ‘fix’ the API.
Secondly, I think a lot of the challenge of this particular project (outside of the aforementioned bugs) involves the
extraReducers object of the
createSlice() options object in
commentSlice.js so remember you have
console.log() (the output of which is viewable in your browser’s devtools) and Redux devtools at your disposal (VERY helpful for viewing the structure of and changes to state).
I hope this is a little helpful!