{"size": 498, "ext": "js", "max_stars_repo_path": "src/services/Favorite.js", "max_stars_repo_name": "aliveghost04/gif-browsing-app-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/services/Favorite.js", "max_issues_repo_name": "aliveghost04/gif-browsing-app-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/services/Favorite.js", "max_forks_repo_name": "aliveghost04/gif-browsing-app-frontend", "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": 19.92, "max_line_length": 50, "alphanum_fraction": 0.546184739}
import http from 'axios';

export default {
  async find(params) {
    return http.get('/favorite', {
      params,
    })
      .then(res => res.data);
  },
  async create(id) {
    return http.post('/favorite', {
      gif_id: id,
    })
      .then(res => res.data);
  },
  async isFavorite(id) {
    return http.get(`/favorite/${id}/is-favorite`)
      .then(res => res.data.isFavorite);
  },
  async delete(id) {
    return http.delete(`/favorite/${id}`)
      .then(res => res.data);
  },
};
