const axios = require('axios').default;

async function companyList(token){
  const response = await axios.get(process.env.backend_url+'/api/companies',{
    headers: {'Authorization': `Bearer ${token}`}
  }).catch((e)=>{
    console.log("Error fetching company List!");
  });
    return (response)?response.data.data:[];
}

module.exports = {companyList};