fix(settings): use $updateProfileError and changePasswordFx per spec
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user