21 lines
No EOL
710 B
JavaScript
21 lines
No EOL
710 B
JavaScript
import axios from "axios";
|
|
import { applicationConfig } from "@/constants/application-config.js";
|
|
|
|
export default {
|
|
callHttpClient({ method, endpoint, payload}) {
|
|
return new Promise((resolve, reject) => {
|
|
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
|
const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "SelfService" });
|
|
|
|
axios({ method: method, url: cfDistroUrl + endpoint, data: payloadAndAnalyticsData, crossDomain: true, responseType: {}})
|
|
.then((response) => {
|
|
return resolve(response);
|
|
},
|
|
error => {
|
|
console.error(error);
|
|
return reject(error.response);
|
|
}
|
|
);
|
|
});
|
|
}
|
|
}; |