other-emerald
other-emerald5mo ago

How can prevent url redirect back to create page after create successfully when resource different?

How can prevent url redirect back to create page after create successfully when resource different default?
2 Replies
kapa.ai
kapa.ai5mo ago
Hi @tingadev. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To prevent a URL redirect back to the create page after a successful creation when using a different resource, you can set the redirect property to false in your form configuration. This will stop the automatic redirection behavior after a successful form mutation. Here's an example using the useForm hook:
useForm({
redirect: false,
});
useForm({
redirect: false,
});
This configuration will ensure that no redirection occurs after the form is successfully submitted. If you need to handle a custom redirection, you can use the useGo hook in the onMutationSuccess callback to navigate to a specific path programmatically. For more details, you can refer to the useForm documentation (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-form/#redirect) and the useGo hook documentation (https://refine.dev/docs/routing/hooks/use-go/#usage). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@761921731505946634> kapa.ai is still learning and improving, please let us know how it did by reacting below

Did you find this page helpful?