// src/api/auth/login.ts
import instance from "../axiosInstance"

export async function login(email: string, password: string) {
  try {
    const { data } = await instance.post("/auth/login", { email, password })
    return data // { token, user }
  } catch (error: any) {
    const message = error.response?.data?.message || "Giriş başarısız"
    console.error("Login hatası:", message)
    throw new Error(message)
  }
}
