import http from './http'

export async function listEpisodes(limit = 50, offset = 0) {
  const response = await http.get('/episodes', { params: { limit, offset } })
  return response.data
}

export async function createEpisode(data) {
  const response = await http.post('/episodes', data)
  return response.data
}

export async function updateEpisode(id, data) {
  const response = await http.patch(`/episodes/${id}`, data)
  return response.data
}

export async function deleteEpisode(id) {
  const response = await http.delete(`/episodes/${id}`)
  return response.data
}