(url, method = "get", params = null, data = null, headers = null, options = null)
| 12 | */ |
| 13 | |
| 14 | const fetch = async (url, method = "get", params = null, data = null, headers = null, options = null) => { |
| 15 | try { |
| 16 | const response = await axios({ |
| 17 | method, |
| 18 | url, |
| 19 | params, |
| 20 | data, |
| 21 | headers, |
| 22 | ...options, |
| 23 | }); |
| 24 | return response; |
| 25 | } catch (err) { |
| 26 | logger.error("Something went wrong. Please contact admin", err); |
| 27 | throw err; |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | module.exports = { |
| 32 | fetch, |
no outgoing calls
no test coverage detected