Refecth query on error using useForm in REST and antd
I have this:
And want to check when is error to refetch data if is a 401
2 Replies
Hi @Sebastos. 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 knowledge sources provided, it seems you are trying to refetch data when a 401 error occurs. However, the code snippet you provided does not include a
refetch
function.
In the useForm
hook, you can access the refetch
function from the queryResult
object. Here is an example of how you can do this:
Please note that this is based on the information provided in the knowledge sources and may need to be adjusted based on your specific use case.
For more information on how to use the useForm
hook in refine, you can refer to the official documentation (https://refine.dev/docs/api-references/hooks/form/useForm).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@689846866837373077> kapa.ai is still learning and improving, please let us know how it did by reacting below