From 7d6973107c2b52e9afba3f57a021185d0be00999 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 11 May 2023 13:01:02 -0400 Subject: [PATCH] CSR-1112 with fix for serviceability call --- .../shop-question/shop-question.vue | 32 +++++++++---------- src/store/index.js | 17 ++++------ 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 434c46d2e..10c1595b2 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -193,25 +193,25 @@ export default { } }, }, - // shopProviders: { - // async handler(newValue) { - // this.resetAnswers(); + shopProviders: { + async handler(newValue) { + //this.resetAnswers(); - // await this.$nextTick(); + await this.$nextTick(); - // if (this.selectedAppointmentType) { - // const selectedShopIndex = newValue.findIndex( - // (provider) => provider.providerNumber == this.modelValue?.providerNumber - // ); + if (this.selectedAppointmentType) { + const selectedShopIndex = newValue.findIndex( + (provider) => provider.providerNumber == this.modelValue + ); - // if (selectedShopIndex >= 3) { - // await this.getNextShopsFromList(selectedShopIndex + 1); - // } else { - // await this.getNextShopsFromList(); - // } - // } - // }, - // }, + if (selectedShopIndex >= 3) { + await this.getNextShopsFromList(selectedShopIndex + 1); + } else { + await this.getNextShopsFromList(); + } + } + }, + }, }, components: { alert, diff --git a/src/store/index.js b/src/store/index.js index c1fbf0e82..d68cee329 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -970,24 +970,21 @@ export const actions = { partNumber: lineItem.partNumber, }) ); - const lineItemsToSend = buildQueryStringParameterFromArrayOfComplexObjects( + const lineItems = buildQueryStringParameterFromArrayOfComplexObjects( lineItemsWithOnlyPartNumbers, "lineItems" ); + const vehicle = context.getters.vehicle; const carId = vehicle.carId; const damage = context.getters.damage; - const glassArray = damage.glassToReplace; - const glassArrayForPayload = convertGlassPieceNamingForApi(glassArray); + const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace); + + const glassPieces = buildQueryStringParameterFromArrayOfComplexObjects(glassArray, "glassPieces") + return globalMethods.callHttpClient({ method: endpoints.GetServiceabilityDetails.method, - endpoint: endpoints.GetServiceabilityDetails.url, - payload: { - zip: serviceZipCode, - lineItems: lineItemsToSend, - carId: carId, - glassPieces: glassArrayForPayload, - }, + endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&${lineItems}&${glassPieces}`, }); },