refactor: rename name→displayName in AuthUser type

This commit is contained in:
Kirill
2026-05-20 10:57:11 +05:00
parent 6fde248dc5
commit 8d9c250eb7
+12 -2
View File
@@ -3,7 +3,17 @@ import { apiClient } from '@/shared/api/client'
import { createErrorStore } from '@/shared/lib/create-error-store'
import { persistToken } from '@/shared/lib/persist-token'
export type AuthUser = { id: string; email: string; name?: string | null; phone?: string | null; isAdmin?: boolean }
export type AuthUser = {
id: string
email: string
displayName?: string | null
firstName?: string | null
lastName?: string | null
gender?: string | null
avatar?: string | null
phone?: string | null
isAdmin?: boolean
}
export const tokenSet = createEvent<string | null>()
export const logout = createEvent()
@@ -58,7 +68,7 @@ export const verifyEmailChangeFx = createEffect(async (params: { newEmail: strin
// ----- Profile update -----
export type UpdateProfileParams = { name: string | null; phone?: string | null }
export type UpdateProfileParams = { displayName: string | null; phone?: string | null }
export const updateProfileFx = createEffect(async (params: UpdateProfileParams) => {
const { data } = await apiClient.patch<{ user: AuthUser }>('me/profile', params)