{"size": 544, "ext": "js", "max_stars_repo_path": "client/src/services/contestantsService.js", "max_stars_repo_name": "MichaelJolley/gamedeck", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/services/contestantsService.js", "max_issues_repo_name": "MichaelJolley/gamedeck", "max_issues_repo_issues_event_min_datetime": "2020-07-29T21:01:18.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T09:36:42.000Z", "max_forks_repo_path": "client/src/services/contestantsService.js", "max_forks_repo_name": "MichaelJolley/gamedeck", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 20.9230769231, "max_line_length": 50, "alphanum_fraction": 0.5551470588}
import Vue from 'vue';

import { apiUrl } from '@/utils';

const baseUrl = `${apiUrl}/contestants`;

export const ContestantsService = {
  get() {
    return Vue.axios.get(baseUrl)
      .catch((error) => {
        throw new Error(error);
      });
  },
  post(contestant) {
    return Vue.axios.post(baseUrl, { contestant })
      .catch((error) => {
        throw new Error(error);
      });
  },
  put(contestant) {
    return Vue.axios.put(baseUrl, { contestant })
      .catch((error) => {
        throw new Error(error);
      });
  },
};