fix(settings): use $updateProfileError and changePasswordFx per spec

This commit is contained in:
Kirill
2026-05-22 15:10:20 +05:00
parent e273c29c36
commit fa276eb7f3
3 changed files with 21 additions and 4 deletions
@@ -8,8 +8,14 @@ import Typography from '@mui/material/Typography'
import { useMutation } from '@tanstack/react-query'
import { useUnit } from 'effector-react'
import { useForm } from 'react-hook-form'
import { apiClient } from '@/shared/api/client'
import { $user, fetchAuthMethodsFx, setPasswordFx, unlinkOAuthFx, type AuthMethod } from '@/shared/model/auth'
import {
$user,
changePasswordFx,
fetchAuthMethodsFx,
setPasswordFx,
unlinkOAuthFx,
type AuthMethod,
} from '@/shared/model/auth'
const METHOD_LABELS: Record<string, string> = { password: 'Пароль', vk: 'ВКонтакте', yandex: 'Яндекс' }
@@ -56,7 +62,7 @@ export function AuthMethodsSection() {
const changePasswordMutation = useMutation({
mutationFn: async (params: { oldPassword: string; newPassword: string }) => {
await apiClient.post('me/change-password', params)
await changePasswordFx(params)
},
onSuccess: () => {
setShowChangePassword(false)