import http from './http'

export async function listTargets() {
  const response = await http.get('/yearly_targets')
  return response.data
}

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

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

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