30 lines
961 B
JavaScript
30 lines
961 B
JavaScript
import axios from "axios";
|
|
import https from 'https';
|
|
|
|
|
|
const agent = new https.Agent({
|
|
rejectUnauthorized: false,
|
|
})
|
|
const crmHeaders = {
|
|
headers:{
|
|
"Content-Type": "application/json; charset=utf-8",
|
|
"OData-MaxVersion": "4.0",
|
|
"OData-Version": "4.0",
|
|
"Accept": "application/json",
|
|
"Prefer": "odata.include-annotations=\"*\"",
|
|
|
|
}
|
|
}
|
|
|
|
|
|
export const getBasicSearch = (searchString) => {
|
|
console.log('got to axios', searchString)
|
|
|
|
return axios
|
|
//.get("https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=contains(title, '" + searchString + "')&$count=true", crmHeaders,{httpsAgent: new https.Agent({rejectUnauthorized:false})})
|
|
.get("http://dummy.restapiexample.com/api/v1/employees")
|
|
.then((res)=>res.data)
|
|
.catch((error)=>{
|
|
console.log(error)
|
|
})
|
|
} |