hello im kinda of a newbie to axios how can i return response.data to the getOrderDetails function ? thanks !
function getOrderDetails(orderid) {
var axios = require("axios").default;
var options = {
method: 'GET',
url: 'https//example.com'+orderid,
headers: {
'Content-Type': 'application/json',
Authorization: '*secret api key*'
}
};
axios.request(options).then(function (response) {
console.log(response.data);
// return this ^^^^^^
}).catch(function (error) {
console.error(error);
});
}