{"size": 562, "ext": "js", "max_stars_repo_path": "public/src/api/patient.js", "max_stars_repo_name": "pagient/pagient-api", "max_stars_repo_stars_event_min_datetime": "2018-07-12T14:50:35.000Z", "max_stars_repo_stars_event_max_datetime": "2018-07-14T12:29:31.000Z", "max_issues_repo_path": "public/src/api/patient.js", "max_issues_repo_name": "pagient/pagient-api", "max_issues_repo_issues_event_min_datetime": "2019-05-22T10:24:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-12T10:04:45.000Z", "max_forks_repo_path": "public/src/api/patient.js", "max_forks_repo_name": "pagient/pagient-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 9, "max_forks_count": null, "avg_line_length": 20.8148148148, "max_line_length": 54, "alphanum_fraction": 0.6886120996}
import axios from "axios";

const base =
  process.env.NODE_ENV === "production"
    ? "/api/patients"
    : `${process.env.VUE_APP_API_ROOT}/api/patients`;

export function getAllPatients() {
  return axios.get(base);
}

export function getPatient(id) {
  return axios.get(base + "/" + id);
}

export function addPatient(patient) {
  return axios.post(base, patient);
}

export function updatePatient(patient) {
  return axios.post(base + "/" + patient.id, patient);
}

export function deletePatient(patient) {
  return axios.delete(base + "/" + patient.id);
}
