/
mpstrkv
/
SpbTechRun
Обзор
Документация
Войти
/
mpstrkv
/
SpbTechRun
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
frontend/src/api/auth.ts
17 строк
630 B
mihailpestrikov
Initial commit: SpbTechRun recommendation system
05 дек 2025, 16:11
05 дек 2025, 16:11
8ba7137
Код
Авторство
О чём код?
import { apiClient } from './client' import type { User, AuthResponse } from '@/types' export async function login(email: string, password: string): Promise<AuthResponse> { const { data } = await apiClient.post<AuthResponse>('/auth/login', { email, password }) return data } export async function register(name: string, email: string, password: string): Promise<AuthResponse> { const { data } = await apiClient.post<AuthResponse>('/auth/register', { name, email, password }) return data } export async function getProfile(): Promise<User> { const { data } = await apiClient.get<User>('/auth/profile') return data }