You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

12 line
356 B

  1. const axios = require('axios').default;
  2. async function companyList(token){
  3. const response = await axios.get(process.env.backend_url+'/api/companies',{
  4. headers: {'Authorization': `Bearer ${token}`}
  5. }).catch((e)=>{
  6. console.log("Error fetching company List!");
  7. });
  8. return (response)?response.data.data:[];
  9. }
  10. module.exports = {companyList};