Temporary fix for v1/v2 split
This commit is contained in:
parent
6e2e7d8ee3
commit
ccae4931af
1 changed files with 21 additions and 12 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import applicationConfig from './application-config';
|
||||||
|
|
||||||
const ACCOUNT_BASE_URL = '/account/api/v1/account';
|
const ACCOUNT_BASE_URL = '/account/api/v1/account';
|
||||||
const ANALYTICS_BASE_URL = '/analytics/api/v1/analytics';
|
const ANALYTICS_BASE_URL = '/analytics/api/v1/analytics';
|
||||||
const CLIENT_AUTH_BASE_URL = '/clientauth/api/v1/clientauth';
|
const CLIENT_AUTH_BASE_URL = '/clientauth/api/v1/clientauth';
|
||||||
|
|
@ -7,11 +9,18 @@ const EXPERIMENTS_BASE_URL = '/experiments/api/v1/experiments';
|
||||||
const LOCATION_BASE_URL = '/location/api/v1/location';
|
const LOCATION_BASE_URL = '/location/api/v1/location';
|
||||||
const ORDER_BASE_URL = '/order/api/v1/order';
|
const ORDER_BASE_URL = '/order/api/v1/order';
|
||||||
const PARTS_BASE_URL = '/parts/api/v2/parts';
|
const PARTS_BASE_URL = '/parts/api/v2/parts';
|
||||||
|
const PARTS_V1_BASE_URL = '/parts/api/v1/parts';
|
||||||
const PRICE_BASE_URL = '/price/api/v1/price';
|
const PRICE_BASE_URL = '/price/api/v1/price';
|
||||||
const SCHEDULE_BASE_URL = '/schedule/api/v1/schedule';
|
const SCHEDULE_BASE_URL = '/schedule/api/v1/schedule';
|
||||||
const VEHICLE_BASE_URL = '/vehicle/api/v1/vehicle';
|
const VEHICLE_BASE_URL = '/vehicle/api/v1/vehicle';
|
||||||
const PAYMENT_BASE_URL = '/payment/api/v1/payment';
|
const PAYMENT_BASE_URL = '/payment/api/v1/payment';
|
||||||
|
|
||||||
|
const isLocalOrDev = (() => {
|
||||||
|
const currentEnv = (applicationConfig?.CURRENT_ENVIRONMENT || '').toLowerCase();
|
||||||
|
return currentEnv === 'localhost' || currentEnv === 'dev';
|
||||||
|
})();
|
||||||
|
const PARTS_EFFECTIVE_BASE_URL = isLocalOrDev ? PARTS_BASE_URL : PARTS_V1_BASE_URL;
|
||||||
|
|
||||||
const endpoints = Object.freeze({
|
const endpoints = Object.freeze({
|
||||||
GetRouteInfo: {
|
GetRouteInfo: {
|
||||||
url: (applicationAbbreviation) => `${CONTENT_BASE_URL}/${applicationAbbreviation}/RouteInfo`,
|
url: (applicationAbbreviation) => `${CONTENT_BASE_URL}/${applicationAbbreviation}/RouteInfo`,
|
||||||
|
|
@ -42,7 +51,7 @@ const endpoints = Object.freeze({
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
},
|
},
|
||||||
GetMobilePremiumFee: {
|
GetMobilePremiumFee: {
|
||||||
url: `${PARTS_BASE_URL}/mobile-premium-fee`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/mobile-premium-fee`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetVehicleYears: {
|
GetVehicleYears: {
|
||||||
|
|
@ -62,15 +71,15 @@ const endpoints = Object.freeze({
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetDamageOptions: {
|
GetDamageOptions: {
|
||||||
url: `${PARTS_BASE_URL}/damage-options`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/damage-options`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetPartsOrQuestions: {
|
GetPartsOrQuestions: {
|
||||||
url: `${PARTS_BASE_URL}/parts-or-questions`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/parts-or-questions`,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
},
|
},
|
||||||
GetParts: {
|
GetParts: {
|
||||||
url: `${PARTS_BASE_URL}/parts`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/parts`,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
},
|
},
|
||||||
GetITACPriceOrderItems: {
|
GetITACPriceOrderItems: {
|
||||||
|
|
@ -99,19 +108,19 @@ const endpoints = Object.freeze({
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetCapabilityQuestions: {
|
GetCapabilityQuestions: {
|
||||||
url: `${PARTS_BASE_URL}/capability-questions`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/capability-questions`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetPartFromCapabilityAnswer: {
|
GetPartFromCapabilityAnswer: {
|
||||||
url: `${PARTS_BASE_URL}/part-from-capability-answer`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/part-from-capability-answer`,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
},
|
},
|
||||||
GetWipers: {
|
GetWipers: {
|
||||||
url: `${PARTS_BASE_URL}/wipers`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/wipers`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetRainDefense: {
|
GetRainDefense: {
|
||||||
url: `${PARTS_BASE_URL}/rain-repel`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/rain-repel`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetRecalParts: {
|
GetRecalParts: {
|
||||||
|
|
@ -123,19 +132,19 @@ const endpoints = Object.freeze({
|
||||||
zipCode,
|
zipCode,
|
||||||
applicationName,
|
applicationName,
|
||||||
referralSequenceNumber
|
referralSequenceNumber
|
||||||
) => `${PARTS_BASE_URL}/recal-parts/${carId}/${partNumber}/${recalibrationType}/${parentAccountNumber}/${zipCode}/${applicationName}/${referralSequenceNumber}`,
|
) => `${PARTS_EFFECTIVE_BASE_URL}/recal-parts/${carId}/${partNumber}/${recalibrationType}/${parentAccountNumber}/${zipCode}/${applicationName}/${referralSequenceNumber}`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetGlassFees: {
|
GetGlassFees: {
|
||||||
url: `${PARTS_BASE_URL}/glass-fees`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/glass-fees`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetSupportingItems: {
|
GetSupportingItems: {
|
||||||
url: `${PARTS_BASE_URL}/supporting-items`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/supporting-items`,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
},
|
},
|
||||||
GetMobileFeePart: {
|
GetMobileFeePart: {
|
||||||
url: `${PARTS_BASE_URL}/mobile-fee`,
|
url: `${PARTS_EFFECTIVE_BASE_URL}/mobile-fee`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
GetServiceabilityDetails: {
|
GetServiceabilityDetails: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue