CSR-945 CSR-969
use lower case for querystring parms
This commit is contained in:
parent
afcd713fdb
commit
9ec12c81bd
5 changed files with 22 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
const queryStrings = {
|
||||
FMG_PAGE: "fmgPage",
|
||||
START_TYPE: "start_type",
|
||||
ZIP_CODE: "zipCode",
|
||||
ZIP_CODE: "zipcode",
|
||||
};
|
||||
|
||||
export { queryStrings };
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
selectedVinLookupMethod: null,
|
||||
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
|
||||
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
|
||||
emailAddress: this.getEmailFromStore(),
|
||||
displayInvalidZipAlert: false,
|
||||
displayNonServiceableZipAlert: false,
|
||||
|
|
@ -147,9 +147,13 @@ export default {
|
|||
//Call APIs
|
||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||
|
||||
const zip = Object.hasOwn(to.query, queryStrings.ZIP_CODE) ? to.query.zipCode : null;
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
const hasZip = urlParams.has(queryStrings.ZIP_CODE);
|
||||
const zip = urlParams.get(queryStrings.ZIP_CODE);
|
||||
|
||||
var vinByAddressPromise;
|
||||
if (zip) {
|
||||
if (hasZip) {
|
||||
vinByAddressPromise = baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE,
|
||||
zip,
|
||||
|
|
@ -189,7 +193,7 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
if (zip) {
|
||||
if (zip && resultMap.vinByAddress === false) {
|
||||
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||
(answer) => answer.Name === "HomeAddress"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
licensePlate: this.getLicensePlateFromStore(),
|
||||
registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipCode,
|
||||
registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipcode,
|
||||
email: this.getEmailFromStore(),
|
||||
serviceZipCode: this.getServiceZipFromStore(),
|
||||
displayNonServiceableZipAlert: false,
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
vin: this.getVinFromStore(),
|
||||
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
|
||||
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
|
||||
emailAddress: this.getEmailFromStore(),
|
||||
isCarIdDifferent: false,
|
||||
customAlertData: {},
|
||||
|
|
|
|||
|
|
@ -265,14 +265,22 @@ async function navigate(
|
|||
fmgPage: destinationFmgPageValue,
|
||||
};
|
||||
|
||||
if (
|
||||
Object.hasOwn(currentRoute.query, queryStrings.ZIP_CODE) &&
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
const lowerCaseParams = new URLSearchParams();
|
||||
for (const [name, value] of urlParams) {
|
||||
lowerCaseParams.append(name.toLowerCase(), value);
|
||||
}
|
||||
const hasZip = lowerCaseParams.has(queryStrings.ZIP_CODE);
|
||||
const zip = lowerCaseParams.get(queryStrings.ZIP_CODE);
|
||||
|
||||
if (hasZip &&
|
||||
(store.getters.order.serviceLocation.zipCode === undefined ||
|
||||
store.getters.order.serviceLocation.zipCode == null) &&
|
||||
(store.getters.order.vehicle.registration.zipCode === undefined ||
|
||||
store.getters.order.vehicle.registration.zipCode == null)
|
||||
) {
|
||||
queryStringsObject[queryStrings.ZIP_CODE] = currentRoute.query.zipCode;
|
||||
queryStringsObject[queryStrings.ZIP_CODE] = zip;
|
||||
}
|
||||
|
||||
router.push({
|
||||
|
|
|
|||
Loading…
Reference in a new issue