fix: rename name to displayName in AdminUser type and page

This commit is contained in:
Kirill
2026-05-21 20:58:50 +05:00
parent 2751332356
commit 7a9e44bc5c
4 changed files with 10 additions and 10 deletions
@@ -25,10 +25,10 @@ import { UserAvatar } from '@/shared/ui/UserAvatar'
type UserFormState = {
email: string
name: string
displayName: string
}
const emptyUserForm = (): UserFormState => ({ email: '', name: '' })
const emptyUserForm = (): UserFormState => ({ email: '', displayName: '' })
function formatDt(v: string) {
try {
@@ -78,7 +78,7 @@ export function AdminUsersPage() {
const v = userForm.getValues()
await createAdminUser({
email: v.email.trim(),
name: v.name.trim() || null,
displayName: v.displayName.trim() || null,
})
},
onSuccess: () => {
@@ -92,7 +92,7 @@ export function AdminUsersPage() {
const v = userForm.getValues()
await updateAdminUser(editing!.id, {
email: v.email.trim(),
name: v.name.trim() || null,
displayName: v.displayName.trim() || null,
})
},
onSuccess: () => {
@@ -119,7 +119,7 @@ export function AdminUsersPage() {
openEditDialog(u)
userForm.reset({
email: u.email,
name: u.name ?? '',
displayName: u.displayName ?? '',
})
}
@@ -201,7 +201,7 @@ export function AdminUsersPage() {
/>
</TableCell>
<TableCell>{u.email}</TableCell>
<TableCell>{u.name ?? '—'}</TableCell>
<TableCell>{u.displayName ?? '—'}</TableCell>
<TableCell>{formatDt(u.createdAt)}</TableCell>
<TableCell>{formatDt(u.updatedAt)}</TableCell>
<TableCell align="right">
@@ -264,7 +264,7 @@ export function AdminUsersPage() {
/>
<Controller
control={userForm.control}
name="name"
name="displayName"
render={({ field }) => <TextField label="Имя/ник" fullWidth {...field} />}
/>
</Stack>