text: import axios from 'axios'
  import {verifyToken} from 'utils/authentication'
  
  import server from './server'
  
  const getAuthorizedHeader = () => ({Authorization: `Token ${verifyToken()}`})
  
  const successResponse = response => ({success: true, ...response.data})
  
  export const get = (endpoint, params = {}) =>
    axios
      .get(`${server}/${endpoint}`, {headers: getAuthorizedHeader(), params})
      .then(successResponse)
      .catch(error => error)
  
  export const put = (endpoint, body, additionalHeaders = {}) =>
    axios
      .put(`${server}/${endpoint}`, body, {headers: {...getAuthorizedHeader(), ...additionalHeaders}})
      .then(successResponse)
      .catch(error => error)
  
  export const patch = (endpoint, body, additionalHeaders = {}) =>
    axios
      .patch(`${server}/${endpoint}`, body, {headers: {...getAuthorizedHeader(), ...additionalHeaders}})
      .then(successResponse)
      .catch(error => error)
  
  export const post = (endpoint, body) =>
    axios
      .post(`${server}/${endpoint}`, body, {headers: getAuthorizedHeader()})
      .then(successResponse)
      .catch(error => error)
  
  export const postNoAuth = (endpoint, body) =>
    axios
      .post(`${server}/${endpoint}`, body, {headers: {}})
      .then(successResponse)
      .catch(error => error)
  
  export const postFile = (endpoint, body) =>
    axios
      .post(`${server}/${endpoint}`, body, {headers: getAuthorizedHeader()})
      .then(successResponse)
      .catch(error => error)
  
  export const del = endpoint =>
    axios
      .delete(`${server}/${endpoint}`, {headers: getAuthorizedHeader()})
      .then(successResponse)
      .catch(error => error)
  