import http from "../http-common";
const getAll = (status) => {
  const params = {};
  if (status) {
    params.status = status;
  }
  return http.get("/labels", {params});
};

const createNewLabel = (data) => {
  data.status = 'active';
	return http.post('/labels', data);
};

const updateLabel = (id, data) => {
  return http.put(`/labels/${id}`, data);
}

const deleteLabel = (id) => {
  return http.delete(`/labels/${id}`)
}

export const LabelService = {
	getAll,
	createNewLabel,
	updateLabel,
	deleteLabel
}