Adding policyLookupSuccessful to store
This commit is contained in:
parent
3376fbb9d5
commit
e21cd97c7b
1 changed files with 7 additions and 0 deletions
|
|
@ -53,6 +53,7 @@ const getDefaultState = () =>
|
||||||
damageState: null,
|
damageState: null,
|
||||||
damageCity: null,
|
damageCity: null,
|
||||||
isDamageGlassOnly: null,
|
isDamageGlassOnly: null,
|
||||||
|
policyLookupSuccessful: null,
|
||||||
noCoverage: null,
|
noCoverage: null,
|
||||||
deductible: {
|
deductible: {
|
||||||
repair: null, // numerical value; how much customer owes on deductible in repair case
|
repair: null, // numerical value; how much customer owes on deductible in repair case
|
||||||
|
|
@ -349,6 +350,7 @@ export const useMainStore = defineStore({
|
||||||
getCoveragePolicyInfo({ accountNumber, policyNumber, dateOfLoss, zipCode }) {
|
getCoveragePolicyInfo({ accountNumber, policyNumber, dateOfLoss, zipCode }) {
|
||||||
// TODO: replace place holder correlationId with the real thing
|
// TODO: replace place holder correlationId with the real thing
|
||||||
const placeHolderCorrelationId = '00000000-0000-0000-0000-000000000000';
|
const placeHolderCorrelationId = '00000000-0000-0000-0000-000000000000';
|
||||||
|
const { policy } = this.order;
|
||||||
try {
|
try {
|
||||||
const response = globalMethods.callHttpClient({
|
const response = globalMethods.callHttpClient({
|
||||||
method: endpoints.CoveragePolicyInfo.method,
|
method: endpoints.CoveragePolicyInfo.method,
|
||||||
|
|
@ -360,9 +362,14 @@ export const useMainStore = defineStore({
|
||||||
zipCode,
|
zipCode,
|
||||||
correlationId: placeHolderCorrelationId
|
correlationId: placeHolderCorrelationId
|
||||||
}
|
}
|
||||||
|
}).then((r) => {
|
||||||
|
const responsePolicy = response.policies?.[0];
|
||||||
|
policy.policyLookupSuccessful = !!responsePolicy;
|
||||||
|
return r;
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
} catch (responseError) {
|
} catch (responseError) {
|
||||||
|
policy.policyLookupSuccessful = false;
|
||||||
return {
|
return {
|
||||||
error: {
|
error: {
|
||||||
status: responseError.status
|
status: responseError.status
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue