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 lines
413 B

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