mirror of
https://github.com/tips-of-mine/gestion-certificats2.git
synced 2025-06-28 17:28:42 +02:00
Modernisation du projet Gestion Certificat
This commit is contained in:
19
src/services/api/auth.ts
Normal file
19
src/services/api/auth.ts
Normal 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
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user