import { axiosClient } from '@/api/axiosClient'
import type { UpdateProductRequest, ProductDetail } from '../types'

export async function updateProduct(
  id: number,
  payload: UpdateProductRequest,
): Promise<ProductDetail> {
  const response = await axiosClient.put<ProductDetail>(
    `/api/v1/admin/products/${id}`,
    payload,
  )
  return response.data
}
