CSR-886: revert global-methods back (had accidentally included local test code)
This commit is contained in:
parent
ffe8e0c817
commit
55837e33ee
1 changed files with 8 additions and 8 deletions
|
|
@ -9,18 +9,18 @@ import { headerKeys } from "@/constants/header-keys";
|
||||||
export default {
|
export default {
|
||||||
callHttpClient({ method, endpoint, payload, logApiCall = true, isFormData = false }) {
|
callHttpClient({ method, endpoint, payload, logApiCall = true, isFormData = false }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
||||||
const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "FixMyGlass" });
|
let payloadAndAnalyticsData = {};
|
||||||
|
if (isFormData) {
|
||||||
|
payloadAndAnalyticsData = payload;
|
||||||
|
payloadAndAnalyticsData.append("AppName", "FixMyGlass");
|
||||||
|
} else {
|
||||||
|
Object.assign(payloadAndAnalyticsData, payload, { AppName: "FixMyGlass" });
|
||||||
|
}
|
||||||
const headers = {
|
const headers = {
|
||||||
[headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings),
|
[headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (endpoint.toLowerCase().includes("/analytics/")) {
|
|
||||||
cfDistroUrl = "";
|
|
||||||
endpoint = "";
|
|
||||||
method = "GET";
|
|
||||||
}
|
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
method: method,
|
method: method,
|
||||||
url: cfDistroUrl + endpoint,
|
url: cfDistroUrl + endpoint,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue