Merge pull request #2577 from Safelite/feature/CASH-916
Remove premature consumption of zip query
This commit is contained in:
commit
37650eb50a
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 { queryStrings } from "@/constants/query-strings";
|
||||
import { nextTick } from "vue";
|
||||
import { consumeQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
||||
import { peekQueryFromStash } from "@/router/methods/helpers/querystring-stash";
|
||||
|
||||
// Define Validation Rules
|
||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||
|
|
@ -100,7 +100,7 @@ export default {
|
|||
}
|
||||
|
||||
const zip =
|
||||
consumeQueryFromStash(queryStrings.ZIP_CODE) ??
|
||||
peekQueryFromStash(queryStrings.ZIP_CODE) ??
|
||||
store.getters.order.serviceLocation.zipCode;
|
||||
|
||||
var vinByAddressPromise;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { reactive } from "vue";
|
||||
import { debugLog } from "@/helpers/debug-log-helper";
|
||||
|
||||
const queryStash = reactive({
|
||||
queries: [],
|
||||
|
|
@ -27,10 +28,18 @@ export function stashAllQueries(toRoute) {
|
|||
}
|
||||
|
||||
function getStashedQuery(key) {
|
||||
debugLog(`Fetching querystring with key:`, key);
|
||||
const match = queryStash.queries.find(
|
||||
(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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue