foreign-sapphire
foreign-sapphire13mo ago

useForm

Hello, in the edit action mode of useForm(), is there a way to disable the inital auto-fetch of a resource using useOne(). I have noticed that useForm() in edit mode automatically uses useOne() to call an api?
2 Replies
kapa.ai
kapa.ai13mo ago
Hi @krockstar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the extracts, useForm() in edit action mode automatically fetches the record data according to the id with useOne() and returns the queryResult for you to fill the form. There is no mention of a way to disable this initial auto-fetch of a resource. Here is the relevant extract for your reference: "action: "edit" is used for editing an existing record. It requires the id for determining the record to edit. By default, it uses the id from the route. It can be changed with the setId function or id property. It fetches the record data according to the id with useOne (https://refine.dev/docs/api-reference/core/hooks/data/useOne/) and returns the queryResult for you to fill the form. After the form is submitted, it updates the record with useUpdate (https://refine.dev/docs/api-reference/core/hooks/data/useUpdate/)." source (https://refine.dev/docs/api-reference/core/hooks/useForm) For more detailed information or potential workarounds, you may want to refer to the official Refine documentation (https://refine.dev/docs). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai13mo ago
<@194753773376241664> kapa.ai is still learning and improving, please let us how it did by reacting below