Files
baya-monorepo/client/src/services/auth/apis/clientApi.ts
T
2026-06-18 01:19:23 +03:30

17 lines
415 B
TypeScript

import { clientFetch } from '@/lib/api/client';
import type { AuthTokens, LoginDto, User } from '../types';
export const AuthClientApi = {
login: (dto: LoginDto) =>
clientFetch<AuthTokens>('/auth/login', {
method: 'POST',
body: JSON.stringify(dto),
}),
logout: () =>
clientFetch<void>('/auth/logout', { method: 'POST' }),
getCurrentUser: () =>
clientFetch<User>('/auth/me'),
};