import type { BuildsData } from '../lib/interfaces/builds.interface'

const index = async (): Promise<BuildsData> => {
  const res = await fetch('/api/builds')
  if (!res.ok) throw new Error(`HTTP ${res.status}`)
  return res.json()
}

export default { index }
