Describe the bugA clear and concise description of what the bug is.
I am having trouble getting my actions (edit, create, delete) on my Index to run the promise correctly (example: triggering a refresh after i delete or navigating to a show page after creation)
What is the problem you are trying to solve?
I want the promise chain's ".then" to work
Expected behaviorA clear and concise description of what you expected to happen.
When you create/edit/delete an artist, the page refreshes to show reflect your action.
What is the actual behavior?A clear and concise description of what actually happened.
Page does not refresh or navigate to a new page upon clicking an action. Also important to note that the actions are indeed working! I just want the changes to be reflected without a manual refresh
Post any code you think might be relevant (one fenced block per file)
//MY ONSUBMIT FUNCTION inside my createArtistModal
const onSubmit = (e) => {
e.preventDefault()
createArtist(user, artistInfo)
//navigate the user to the artist show page
.then(res => { navigate(`/artists/${person.id}`)}) //<---- the error is in the URL variable but I've tried multiple variables and they all dont work***
//show the user a successful message alert
.then(() => {
msgAlert({
heading: 'Nice job!',
message: createArtistSuccess,
variant: 'success'
})
})
//if an error occurs, send failure message to user
.catch(() => {
msgAlert({
heading: 'Uh Oh!',
message: createArtistFailure,
variant: 'danger'
})
})
}
What is your best guess as to the source of the problem?
I think the variable names are getting confused and I'm maybe not pulling props the right way.
What things have you already tried to solve the problem?
I have tried variations of url endpoint variables and tried trigger refresh as well.
Additional context
Add any other context about the problem here.
All of this is taking place inside the Artists folder inside components. (I suspect that you may need to look at multiple files to understand whats going on). Or just let me know the other code blocks to include!
Describe the bug A clear and concise description of what the bug is. I am having trouble getting my actions (edit, create, delete) on my Index to run the promise correctly (example: triggering a refresh after i delete or navigating to a show page after creation)
What is the problem you are trying to solve? I want the promise chain's ".then" to work
Expected behavior A clear and concise description of what you expected to happen. When you create/edit/delete an artist, the page refreshes to show reflect your action.
What is the actual behavior? A clear and concise description of what actually happened. Page does not refresh or navigate to a new page upon clicking an action. Also important to note that the actions are indeed working! I just want the changes to be reflected without a manual refresh
Post any code you think might be relevant (one fenced block per file)
What is your best guess as to the source of the problem? I think the variable names are getting confused and I'm maybe not pulling props the right way.
What things have you already tried to solve the problem? I have tried variations of url endpoint variables and tried trigger refresh as well.
Additional context Add any other context about the problem here. All of this is taking place inside the Artists folder inside components. (I suspect that you may need to look at multiple files to understand whats going on). Or just let me know the other code blocks to include!
Paste a link to your repository here https://github.com/brianaleew/Project-3-FrontEnd