This is my code and I have been trying to understand why data is always promise pending.
const axios = require('axios');
const { resolve,reject } = require('bluebird');
async function getData() {
const test = await axios.get(`http://localhost:3000/admin/dashboarddata/tabledata`).then((response)=>{
return response
}).catch();
// console.log(test.data)
var val = test
return test;
}
const data = getData();
console.log(data)