adverse-sapphire
adverse-sapphireโ€ข17mo ago

How Can I add some code before I save in Edit Basic View?

โ„น๏ธ info I got an Edit Basic View, and I want to do something before the form submitted. I want to restructure my data (turn several fields to a JSON in database) before the form submitted. My thinking is Restructure the data before form updated (the save button onClick) So I did what the picture shows. โ“ issue 1. I seems the onClick property will be overwrite if I set it by myself 2. Is there's another or proper way to achieve my purpose? or I have to reinvent the onClick function? ๐Ÿ™โ€
No description
4 Replies
xenial-black
xenial-blackโ€ข17mo ago
Hey @ๅŠ‰ๅ“ฒๅฎ‡ can you check this https://refine.dev/docs/api-reference/antd/hooks/form/useForm/#how-can-i-change-the-form-data-before-submitting-it-to-the-api I think this is what you're looking for ๐Ÿ˜…
useForm | refine
useForm is used to manage forms. It returns the necessary properties and methods to control the Antd Form. Also, it has been developed by using useForm imported from @pankod/refine-core package.
adverse-sapphire
adverse-sapphireโ€ข17mo ago
@aliemirs thank you for the instant help! ๐Ÿ™ There are so many docs to read ๐Ÿ˜…
xenial-black
xenial-blackโ€ข17mo ago
We're working on reorganizing and rewriting them to be better navigated and be understandable ๐Ÿ˜… If you see any issues, please let us know ๐Ÿ™
adverse-sapphire
adverse-sapphireโ€ข17mo ago
๐Ÿป