how to manipulate data for stepForm ant d
how to manipulate data for stepForm ant d before calling api
useStepsForm with Ant Design before submitting it to the API in a Refine application, you can override the submit function within the useStepsForm hook. This allows you to modify the form data as needed. For example, if you need to combine the values of two separate inputs, name and surname, into a single fullName field before sending it to the API, you can do so as follows:submit function is overridden to combine name and surname into fullName, along with other fields like age and city, before calling the onFinish method with the modified data.useStepsForm in Refine with Ant Design: useStepsForm - How can I change the form data before submitting it to the API? (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-steps-form#how-can-i-change-the-form-data-before-submitting-it-to-the-api)submitsubmitsurnamesurnamefullNamefullNameageonFinishimport { useStepsForm } from "@refinedev/antd";
// ...
const { current, gotoStep, stepsProps, formProps, saveButtonProps, onFinish } = useStepsForm<IPost>({
submit: (values) => {
const data = {
fullName: `${values.name} ${values.surname}`,
age: values.age,
city: values.city,
};
onFinish(data as any);
},
});
// ...