import { apiGet, apiPost } from '@/lib/http'
import type { AdminLoginResponse, AdminSessionSummary } from '@/types/admin'

export function loginAdmin(payload: { username: string; password: string }) {
  return apiPost<AdminLoginResponse>('/api/v1/admin/auth/login', payload)
}

export function fetchAdminSession() {
  return apiGet<AdminSessionSummary>('/api/v1/admin/auth/session')
}

export function logoutAdmin() {
  return apiPost<{ success: boolean }>('/api/v1/admin/auth/logout', {})
}
