admin管理员组

文章数量:1355679

I was trying to make edit request to BE(Back End) and I don't have to give not edited values to the BE.

  const handleEdit = async (values: typeof initials) => {
    ----------------------------------------------
    if (initialValues?pany_api_user_username)
      delete valuespany_api_user_username;
    ----------------------------------------------
    try {
      await companiesApi.editCompanyById(
        {
          ...values,
          phone: values.phone ? '+1' + values.phone : '',
          call_center: values.call_center ? '+1' + values.call_center : '',
        },
        id
      );
      dispatch(fetchCompanies());
      navigate('/companies');
      toast.success('Saved!');
    } catch (error) {
      console.error(error);
    }
  };

本文标签: reactjsHow to get only edited values in react formikStack Overflow