{"size": 1076, "ext": "js", "max_stars_repo_path": "src/service/api/rawMaterial.js", "max_stars_repo_name": "Bee-Reign/web-application", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/service/api/rawMaterial.js", "max_issues_repo_name": "Bee-Reign/web-application", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/service/api/rawMaterial.js", "max_forks_repo_name": "Bee-Reign/web-application", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.5897435897, "max_line_length": 79, "alphanum_fraction": 0.7676579926}
import endPoints from "@service/api";
import { postData, getData, patchData, deleteData } from "@libs/fetchService";

export async function getRawMaterials(limit, offset, filter) {
  const response = await getData(
    endPoints.rawMaterials.getRawMaterials(limit, offset, filter)
  );
  return response.data;
}

export async function getAllRawMaterials(query) {
  const response = await getData(
    endPoints.rawMaterials.getAllRawMaterials(query)
  );
  return response.data;
}

export async function getRawMaterial(id) {
  const response = await getData(endPoints.rawMaterials.getRawMaterial(id));
  return response.data;
}

export async function addRawMaterial(body) {
  const response = await postData(endPoints.rawMaterials.addRawMaterial, body);
  return response.data;
}

export async function updateRawMaterial(id, body) {
  const response = await patchData(
    endPoints.rawMaterials.updateRawMaterial(id),
    body
  );
  return response.data;
}

export async function disableRawMaterial(id) {
  await deleteData(endPoints.rawMaterials.disableRawMaterial(id));
}
