/
Danik-Off
/
ProjectV
Обзор
Документация
Войти
/
Danik-Off
/
ProjectV
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
frontend/src/services/userService.ts
26 строк
810 B
Ovchinnikov Danila
feat: вкладка профиль в настройки
15 авг 2025, 23:53
15 авг 2025, 23:53
68a62c2
Код
Авторство
О чём код?
import { apiClient } from '../utils/apiClient'; export const userService = { get: async (id: number | null = null) => { const data = await apiClient(`/auth/users/${id}`, { method: 'GET', }); return data; }, updateProfile: async (id: number, profileData: { username: string; email: string }) => { const data = await apiClient(`/auth/users/${id}`, { method: 'PUT', body: JSON.stringify(profileData), }); return data; }, changePassword: async (id: number, oldPassword: string, newPassword: string) => { const data = await apiClient(`/auth/users/${id}/password`, { method: 'PUT', body: JSON.stringify({ oldPassword, newPassword }), }); return data; }, };