mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-16 13:14:17 -05:00
2e112e2406
* Add semi to ESLint rules * Add padded-blocks to ESLint rules * Add comma-dangle to ESLint rules * add config/webpack and storyboard * add streaming/ * yarn test:lint -- --fix
27 lines
513 B
JavaScript
27 lines
513 B
JavaScript
import axios from 'axios';
|
|
import LinkHeader from './link_header';
|
|
|
|
export const getLinks = response => {
|
|
const value = response.headers.link;
|
|
|
|
if (!value) {
|
|
return { refs: [] };
|
|
}
|
|
|
|
return LinkHeader.parse(value);
|
|
};
|
|
|
|
export default getState => axios.create({
|
|
headers: {
|
|
'Authorization': `Bearer ${getState().getIn(['meta', 'access_token'], '')}`,
|
|
},
|
|
|
|
transformResponse: [function (data) {
|
|
try {
|
|
return JSON.parse(data);
|
|
} catch(Exception) {
|
|
return data;
|
|
}
|
|
}],
|
|
});
|