refactor: rename name→displayName in AuthUser type
This commit is contained in:
@@ -3,7 +3,17 @@ import { apiClient } from '@/shared/api/client'
|
|||||||
import { createErrorStore } from '@/shared/lib/create-error-store'
|
import { createErrorStore } from '@/shared/lib/create-error-store'
|
||||||
import { persistToken } from '@/shared/lib/persist-token'
|
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 tokenSet = createEvent<string | null>()
|
||||||
export const logout = createEvent()
|
export const logout = createEvent()
|
||||||
@@ -58,7 +68,7 @@ export const verifyEmailChangeFx = createEffect(async (params: { newEmail: strin
|
|||||||
|
|
||||||
// ----- Profile update -----
|
// ----- 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) => {
|
export const updateProfileFx = createEffect(async (params: UpdateProfileParams) => {
|
||||||
const { data } = await apiClient.patch<{ user: AuthUser }>('me/profile', params)
|
const { data } = await apiClient.patch<{ user: AuthUser }>('me/profile', params)
|
||||||
|
|||||||
Reference in New Issue
Block a user