import request from './request'
import type { LoginRequest, LoginResponse, User } from '@/types'

export const authApi = {
  // Login
  login: (data: LoginRequest) => {
    return request.post<any, LoginResponse>('/auth/login', data)
  },

  // Get current user
  getCurrentUser: () => {
    return request.get<any, User>('/auth/me')
  },

  // Logout
  logout: () => {
    return request.post('/auth/logout')
  },
}