diff --git a/client/src/pages/me/ui/sections/ProfileSection.tsx b/client/src/pages/me/ui/sections/ProfileSection.tsx
index c167299..5026b19 100644
--- a/client/src/pages/me/ui/sections/ProfileSection.tsx
+++ b/client/src/pages/me/ui/sections/ProfileSection.tsx
@@ -7,6 +7,7 @@ import TextField from '@mui/material/TextField'
import Typography from '@mui/material/Typography'
import { useUnit } from 'effector-react'
import { useForm } from 'react-hook-form'
+import { getApiErrorMessage } from '@/shared/lib/get-api-error-message'
import { $user, $updateProfileError, updateProfileFx } from '@/shared/model/auth'
export function ProfileSection() {
@@ -14,6 +15,8 @@ export function ProfileSection() {
const pendingProfile = useUnit(updateProfileFx.pending)
const updateProfileError = useUnit($updateProfileError)
+ const profileErrorMsg = getApiErrorMessage(updateProfileError)
+
const profileForm = useForm<{ displayName: string }>({
defaultValues: { displayName: user?.displayName ? String(user.displayName) : '' },
mode: 'onChange',
@@ -35,9 +38,9 @@ export function ProfileSection() {
slotProps={{ htmlInput: { maxLength: 40 } }}
{...profileForm.register('displayName')}
/>
- {updateProfileError && (
+ {profileErrorMsg && (
- {updateProfileError}
+ {profileErrorMsg}
)}