Pass extra parameters in useForm
How can I pass extra parameters during the save operations in the antd useForm hook? For example, I want to pass all of the form data and then another parameter called "entityTypeId".
2 Replies
Hi @MesbearizingMeat. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
You can pass extra parameters during the save operations in the
useForm
hook by modifying the onFinish
function. In the onFinish
function, you can add your extra parameters to the values object. Here is an example:
In this example, entityTypeId
is the extra parameter that you want to pass. Replace 'yourEntityTypeId'
with the actual value you want to pass.
This code is based on the example provided in the Refine documentation (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-form#how-can-i-change-the-form-data-before-submitting-it-to-the-api).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@224018850419572736> kapa.ai is still learning and improving, please let us know how it did by reacting below