Closed AsiaOsman06 closed 1 month ago
Let's get this fixed!
First off, here are a few things to verify that'll help you isolate the problem:
DELETE
route works.
workout.router.js
doesn't have a route parameter defined. (Compare Line 63 to Line 23.)dispatch
sent by your deleteWorkoutPlan
function contains the correct id
value as its payload.deleteExercise
Saga function is logging out the correct action.payload
value.Each one of these ☝️ things is important context that should ideally be included in an issue report. You did a great job communicating what isn't working, but collaboratively solving problems also requires communicating very clearly about which specific bits are working. 🙂
All of that said, I took a quick peek at your code, and it looks like you're doing the right thing! But, it also looks like you're doing an extra/unnecessary thing that might be causing the infinite loop:
Within your deleteExercise
Saga function, once this line of code is working:
yield axios.delete(`/api/workout/workoutPlan/${action.payload}`, config);
You'd just need to call your fetchWorkoutPlans
Saga function to "bring your workoutPlan
reducer back in sync with the workout_plan
table." Remember that we can do that with yield put()
:
yield put({type: 'FETCH_WORKOUT_PLANS'})
Let me know if this helps the issue!
Description
Your Real Name
Asia Osman
What do you want to happen? i just need it when i click delete button to delete it forever. What is actually happening?
when i delete an exercise is not delete from backend or my database and it giving an infinite delete until i stop the server it wont stop.
Screenshots / Code Snippets
What did you try? Who did you ask?
i use my previous class assignments making sure my delete dispatch type is same on both saga and reducer. other than i don't see anything wrong with my code after i ask suzzy for help and she help but she was busy doing her solo project
What branch is your code on? Did you git push?
my main branch FitnessFollower_App yes
When was the last time you took a break?
just my day get started