import { api } from '@/lib/axios'

export type SignInProps = {
  email: string
  password: string
}

export type SignInResponse = {
  access_token: string
  user: {
    id: string
    name: string
    email: string
  }
}

export async function login(data: SignInProps) {
  const token = await api.post<SignInResponse>('/login', data)
  return token
}
