import $http from '@/common/request.js';

export {
  // 在资管方搜索公司
  companySearchUnderOwner,
  getCompanyById,
  // 获取该公司的Oa系统
  getCompanyOa,
  // 获取公司配置
  getCompanyConfig
};


function getCompanyById(id) {
  return $http({
    url: `/company/${id}`,
    method: 'GET',
  });
}

function getCompanyOa(companyId) {
  return $http({
    url: `/company/oa/${companyId}`,
    method: 'GET',
  });
}


function companySearchUnderOwner(query, isNotShowErrorToast=false) {
  query = decodeURIComponent(query);
  return $http({
    url: `/company/underOwner/${query}`,
    method: 'GET',
    isNotShowErrorToast
  });
}

function getCompanyConfig(companyId){
  return $http({
    url: `/company/config/${companyId}`,
    method: 'GET'
  });
} 
