AuthorizedUserService.js 628 B

1234567891011121314151617181920212223242526
  1. import axios from "axios";
  2. import store from "@/store/index";
  3. const AuthorizedUserService = axios.create({
  4. withCredentials: true,
  5. baseURL: `https://api.amic.ru/api/v1/comments`,
  6. headers: {
  7. "key" : "Accept",
  8. "value" : "application/json",
  9. "description" : "",
  10. "type" : "text",
  11. "enabled": true,
  12. },
  13. });
  14. export default {
  15. createComment(comment, token) {
  16. return AuthorizedUserService.post("/create", {
  17. text: comment.text,
  18. pull: comment.pullId
  19. },
  20. {
  21. headers: {
  22. "AccessToken" : token
  23. }})
  24. }
  25. }