Hello i am wondering how can i go to my next component. Here is my code it doesn't work. I am using vuex and axios thanks

I think @click.prevent is going to prevent the button event from bubbling up to the inertia-link component, so the visit handler doesn't get fired.
What does createPatientProfile do? Based on this small snippet, I think you want something like this:
<template>
<button class="btn-indigo" type="button" @click="createPatientProfile(formPatient)">
Submit
</button>
</template>
<script>
export default {
// …
methods: {
createPatientProfile(data) {
this.$inertia.post('/patients', data, { preserveState: true })
}
}
}
</script>
The /patients POST endpoint then needs to return a redirect to /partients/card-info.
Does that help? If it doesn't, please provide as much context as possible of what you're trying to achieve (routes, controllers, full components, etc.)
@sebastiandedeyne thank you! This is what I'm exactly looking for.
Most helpful comment
I think
@click.preventis going to prevent thebuttonevent from bubbling up to theinertia-linkcomponent, so the visit handler doesn't get fired.What does
createPatientProfiledo? Based on this small snippet, I think you want something like this:The
/patientsPOSTendpoint then needs to return a redirect to/partients/card-info.Does that help? If it doesn't, please provide as much context as possible of what you're trying to achieve (routes, controllers, full components, etc.)