import axios from "axios"; const CommentsService = axios.create({ withCredentials: true, baseURL: `https://api.amic.ru/api/v1/comments`, headers: { "key":"Accept", "value":"application/json", "description":"", "type":"text", "enabled":true }, }); export default { getCommentsList(pullId, pageNumber) { return CommentsService.get("/pull_" + pullId + (pageNumber ? 'page_' + pageNumber : '')) .then((CommentsList) => { return CommentsList.data.data }) .catch((error) => { console.log(error) }) }, getLastCommentsList() { return CommentsService.get("/last") .then((lastCommentsList) => { return lastCommentsList.data.data }) .catch((error) => { console.log(error) }) } }