base commit

This commit is contained in:
@kirill.komarov
2026-04-29 18:34:25 +05:00
parent f6b6959268
commit 326521c9e6
20 changed files with 1825 additions and 36 deletions
+4 -2
View File
@@ -1,7 +1,7 @@
import { createEffect, createEvent, createStore, sample } from 'effector'
import { apiClient } from '@/shared/api/client'
export type AuthUser = { id: string; email: string; name?: string | null }
export type AuthUser = { id: string; email: string; name?: string | null; phone?: string | null }
const TOKEN_KEY = 'craftshop_auth_token'
@@ -28,7 +28,9 @@ export const verifyEmailChangeFx = createEffect(async (params: { newEmail: strin
return data.user
})
export const updateProfileFx = createEffect(async (params: { name: string | null }) => {
export type UpdateProfileParams = { name: string | null; phone?: string | null }
export const updateProfileFx = createEffect(async (params: UpdateProfileParams) => {
const { data } = await apiClient.patch<{ user: AuthUser }>('me/profile', params)
return data.user
})