Skip to content

Overwrite the form data before insert #3017

Answered by omeraplak
pinale asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @pinale ,
Thank you for contacting us. I've created an example for you! I hope it works for you 🚀

 const {
    handleSubmit,
    saveButtonProps,
    refineCore: { queryResult, onFinish },
    register,
    control,
    formState: { errors },
  } = useForm<
    IPost,
    HttpError,
    IPost & {
      category: ICategory;
    }
  >();


  return (
    <Edit
      saveButtonProps={{
        ...saveButtonProps,
        onClick: (e: React.BaseSyntheticEvent) => {
          handleSubmit(
            (values) => {
              onFinish({
                ...values,
              });
            },
            () => false
          )(e);
        },
      }}
    >
      <Box
        component=

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pinale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants