Remove premature consumption of zip query
This commit is contained in:
parent
03ecb2743f
commit
b3fd46350f
2 changed files with 11 additions and 2 deletions
|
|
@ -62,7 +62,7 @@ import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
import { consumeQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
import { peekQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -100,7 +100,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const zip =
|
const zip =
|
||||||
consumeQueryFromStash(queryStrings.ZIP_CODE) ??
|
peekQueryFromStash(queryStrings.ZIP_CODE) ??
|
||||||
store.getters.order.serviceLocation.zipCode;
|
store.getters.order.serviceLocation.zipCode;
|
||||||
|
|
||||||
var vinByAddressPromise;
|
var vinByAddressPromise;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
const queryStash = reactive({
|
const queryStash = reactive({
|
||||||
queries: [],
|
queries: [],
|
||||||
|
|
@ -27,10 +28,18 @@ export function stashAllQueries(toRoute) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStashedQuery(key) {
|
function getStashedQuery(key) {
|
||||||
|
debugLog(`Fetching querystring with key:`, key);
|
||||||
const match = queryStash.queries.find(
|
const match = queryStash.queries.find(
|
||||||
(entry) => entry?.key?.toLowerCase() === key?.toLowerCase()
|
(entry) => entry?.key?.toLowerCase() === key?.toLowerCase()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
debugLog(`Found result:`, match.value);
|
||||||
|
debugLog(`Already consumed:`, match.used);
|
||||||
|
} else {
|
||||||
|
debugLog(`Found no result`);
|
||||||
|
}
|
||||||
|
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue