You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
382 B

  1. import axios from 'axios';
  2. import LinkHeader from 'http-link-header';
  3. export const getLinks = response => {
  4. return LinkHeader.parse(response.headers.link);
  5. };
  6. export default getState => axios.create({
  7. headers: {
  8. 'Authorization': `Bearer ${getState().getIn(['meta', 'access_token'], '')}`
  9. },
  10. transformResponse: [function (data) {
  11. return JSON.parse(data);
  12. }]
  13. });