diff --git a/src/components/Forms/User/UpdateUserContactsForm.tsx b/src/components/Forms/User/UpdateUserContactsForm.tsx index 52a0b0f..4fb374c 100644 --- a/src/components/Forms/User/UpdateUserContactsForm.tsx +++ b/src/components/Forms/User/UpdateUserContactsForm.tsx @@ -11,6 +11,7 @@ import { yupResolver } from '@hookform/resolvers/yup'; import UpdateUserContactsSchema from 'validators/UpdateUserContactsSchema'; import useUpdateUserContactsQuery from 'hooks/useUpdateUserContactsQuery'; +import { observer } from 'mobx-react'; type UpdateUserContactsInputType = { phone_number: string | null; @@ -41,7 +42,14 @@ const UpdateUserContactsForm: React.FC = ({ contact const { updateContacts, loading } = useUpdateUserContactsQuery(); const onSubmit: SubmitHandler = data => { - updateContacts(data).finally(() => reset(data)); + updateContacts(data).finally(() => + reset({ + phone_number: data.phone_number ?? '', + twitter_id: data.twitter_id ?? '', + telegram_id: data.telegram_id ?? '', + vk_id: data.vk_id ?? '', + }) + ); }; return ( @@ -106,4 +114,4 @@ const UpdateUserContactsForm: React.FC = ({ contact ); }; -export default UpdateUserContactsForm; +export default observer(UpdateUserContactsForm);