import { apiGet } from '@/lib/http'
import type { AdminOrderDetail, AdminOrderListItem, AdminPagination } from '@/types/admin'

export function fetchAdminOrders(params?: Record<string, unknown>) {
  return apiGet<{ items: AdminOrderListItem[]; pagination: AdminPagination }>(
    '/api/v1/admin/orders',
    params,
  )
}

export function fetchAdminOrderDetail(orderId: number | string) {
  return apiGet<AdminOrderDetail>(`/api/v1/admin/orders/${orderId}`)
}
