Adding multiple child entities during creation of Parent entity.
I have requirement where I need to add multiple phone numbers to a user before we save the user create/edit form. Can you point me to some resources which would address such a use case using refine.
8 Replies
stormy-gold•3y ago
Hey @srinivasarajui,
I'm asking for a more detailed understanding. Do you want to send request the user's phone values before creating or editing a user record?
unwilling-turquoiseOP•3y ago
I want to add multiple phone numbers before I do post to the backend to create the user.
So for user i need to add multiple numbers and create the user in one go
stormy-gold•3y ago
You can checkout the dynamic form item demo in here. https://ant.design/components/form/#components-form-demo-dynamic-form-item
Is this what you are looking for?
https://refine.dev/docs/faq/#how-can-i-change-the-form-data-before-submitting-it-to-the-api
https://refine.dev/docs/ui-frameworks/antd/hooks/form/useForm/
useForm | refine
useForm is used to manage forms. It uses Ant Design Form data scope management under the hood and returns the required props for managing the form actions.
FAQ | refine
How can I change the form data before submitting it to the API?
unwilling-turquoiseOP•3y ago
something like this but in refine
Oh i see. You can follow the Ant document. There will be no difference in your use with refine ⚡️
unwilling-turquoiseOP•3y ago
This would work for me thanks
Wow, congrats!! 💯
How about creating an example for other refine users? It can be a good example for our other users 🍻 @srinivasarajui