(headers={})
| 14 | /* Get the axios instance to call back end APIs. |
| 15 | Do not import axios directly, instead use this */ |
| 16 | export default function getApiInstance(headers={}) { |
| 17 | return axios.create({ |
| 18 | headers: { |
| 19 | 'Content-type': 'application/json', |
| 20 | [pgAdmin.csrf_token_header]: pgAdmin.csrf_token, |
| 21 | ...headers, |
| 22 | } |
| 23 | }); |
| 24 | } |
| 25 | |
| 26 | export function parseApiError(error, withData=false) { |
| 27 | if (error.response) { |
no test coverage detected