import { axiosClient } from '@/api/axiosClient'
import type { ListProductsParams, PagedResult, ProductListItem } from '../types'

export async function listProducts(
  params?: ListProductsParams,
): Promise<PagedResult<ProductListItem>> {
  const response = await axiosClient.get<PagedResult<ProductListItem>>(
    '/api/v1/products',
    { params },
  )
  return response.data
}
