feat: creats frontend for the project
This commit is contained in:
14
frontend/src/api/auth.ts
Normal file
14
frontend/src/api/auth.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { LoginRequest, MeResponse } from '@family-budget/shared';
|
||||
import { api } from './client';
|
||||
|
||||
export async function login(data: LoginRequest): Promise<void> {
|
||||
await api.post('/api/auth/login', data);
|
||||
}
|
||||
|
||||
export async function logout(): Promise<void> {
|
||||
await api.post('/api/auth/logout');
|
||||
}
|
||||
|
||||
export async function getMe(): Promise<MeResponse> {
|
||||
return api.get<MeResponse>('/api/auth/me');
|
||||
}
|
||||
Reference in New Issue
Block a user