mirror of
https://github.com/tips-of-mine/gestion-certificats2.git
synced 2025-06-28 06:58:43 +02:00
19 lines
589 B
TypeScript
19 lines
589 B
TypeScript
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
|
|
},
|
|
} |