Modernisation du projet Gestion Certificat

This commit is contained in:
tips-of-mine
2025-06-16 14:36:10 +02:00
committed by GitHub
parent 145476960b
commit f32805f1c1
32 changed files with 9996 additions and 0 deletions

19
src/services/api/auth.ts Normal file
View File

@ -0,0 +1,19 @@
import { ApiResponse, AuthUser, LoginCredentials } from '../../types'
import { apiClient } from './client'
export const authApi = {
login: async (credentials: LoginCredentials): Promise<ApiResponse<AuthUser>> => {
const response = await apiClient.post('/auth/login', credentials)
return response.data
},
logout: async (): Promise<ApiResponse> => {
const response = await apiClient.post('/auth/logout')
return response.data
},
me: async (): Promise<ApiResponse<AuthUser>> => {
const response = await apiClient.get('/auth/me')
return response.data
},
}