Merge branch 'release/2023.03.09' into rlsmerge/2023.03.09-to-develop-v2
This commit is contained in:
commit
97f300a1f5
4 changed files with 37 additions and 0 deletions
|
|
@ -54,6 +54,10 @@ const endpoints = {
|
||||||
url: "/vehicle/api/v1/vehicle/lookup-vin-by-address",
|
url: "/vehicle/api/v1/vehicle/lookup-vin-by-address",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
},
|
},
|
||||||
|
IsVinByAddressPermissible: {
|
||||||
|
url: "/vehicle/api/v1/vehicle/is-vin-by-address-permissible",
|
||||||
|
method: "GET",
|
||||||
|
},
|
||||||
GetPartsOrQuestions: {
|
GetPartsOrQuestions: {
|
||||||
url: "/parts/api/v1/parts/parts-or-questions",
|
url: "/parts/api/v1/parts/parts-or-questions",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ const storeActions = {
|
||||||
GET_DAMAGE_OPTIONS: "getDamageOptions",
|
GET_DAMAGE_OPTIONS: "getDamageOptions",
|
||||||
GET_EVOX_IMAGE: "getEvoxImage",
|
GET_EVOX_IMAGE: "getEvoxImage",
|
||||||
IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle",
|
IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle",
|
||||||
|
IS_VIN_BY_ADDRESS_PERMISSIBLE: "isVinByAddressPermissible",
|
||||||
|
|
||||||
// Lookup Actions
|
// Lookup Actions
|
||||||
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",
|
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,8 @@ import { experimentSettings } from "@/constants/experiments";
|
||||||
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -145,12 +147,27 @@ export default {
|
||||||
//Call APIs
|
//Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
|
|
||||||
|
const zip = Object.hasOwn(to.query, queryStrings.ZIP_CODE) ? to.query.zipCode : null;
|
||||||
|
var vinByAddressPromise;
|
||||||
|
if (zip) {
|
||||||
|
vinByAddressPromise = baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE,
|
||||||
|
zip,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//Settle promises and get results
|
//Settle promises and get results
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
zip != null &&
|
||||||
|
zip != undefined && {
|
||||||
|
resultKey: "vinByAddress",
|
||||||
|
promise: vinByAddressPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
@ -172,6 +189,14 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (zip) {
|
||||||
|
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||||
|
(answer) => answer.Name === "HomeAddress"
|
||||||
|
);
|
||||||
|
if (indexToRemove) {
|
||||||
|
resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -530,6 +530,13 @@ export const actions = {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
isVinByAddressPermissible(context, zip) {
|
||||||
|
return globalMethods.callHttpClient({
|
||||||
|
method: endpoints.IsVinByAddressPermissible.method,
|
||||||
|
endpoint: `${endpoints.IsVinByAddressPermissible.url}?zipcode=${zip}`,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
},
|
||||||
getVehicleMakes(context, { year }) {
|
getVehicleMakes(context, { year }) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetVehicleMakes.method,
|
method: endpoints.GetVehicleMakes.method,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue