return empty if call returns 500

This commit is contained in:
Bill Richardson 2026-07-23 15:56:47 -04:00
parent 36fbca4ba0
commit f2b9df02de
2 changed files with 21 additions and 3 deletions

View file

@ -10,6 +10,7 @@ export default {
if (this.mainStore.order.vehicle.vinRequired) { if (this.mainStore.order.vehicle.vinRequired) {
result = await useMainStore().getPartsOrQuestionsV2(); result = await useMainStore().getPartsOrQuestionsV2();
if (result.data.partsOrQuestions.length === 0) { if (result.data.partsOrQuestions.length === 0) {
useMainStore().resetBailout();
this.navigateBailout(bailoutMessage.YMMNotFound('No Parts Returned')); this.navigateBailout(bailoutMessage.YMMNotFound('No Parts Returned'));
return; return;
} }
@ -26,6 +27,7 @@ export default {
this.mainStore.order.vehicle.vin = vin; this.mainStore.order.vehicle.vin = vin;
if (hasYMMExperimentBailoutSettingEnabled()) { if (hasYMMExperimentBailoutSettingEnabled()) {
useMainStore().resetBailout();
this.navigateBailout(bailoutMessage.YMMNotFound()); this.navigateBailout(bailoutMessage.YMMNotFound());
return true; return true;
} }
@ -33,6 +35,7 @@ export default {
if (hasYMMExperimentPageSettingEnabled()) { if (hasYMMExperimentPageSettingEnabled()) {
const partsOrQuestionsResponse = await useMainStore().getPartsOrQuestionsV2(); const partsOrQuestionsResponse = await useMainStore().getPartsOrQuestionsV2();
if (partsOrQuestionsResponse.data.partsOrQuestions.length === 0) { if (partsOrQuestionsResponse.data.partsOrQuestions.length === 0) {
useMainStore().resetBailout();
this.navigateBailout(bailoutMessage.YMMNotFound('No Parts Returned')); this.navigateBailout(bailoutMessage.YMMNotFound('No Parts Returned'));
return true; return true;
} }

View file

@ -891,6 +891,13 @@ export const useMainStore = defineStore({
method: endpoints.GetPartsOrQuestionsV2.method, method: endpoints.GetPartsOrQuestionsV2.method,
endpoint: endpoints.GetPartsOrQuestionsV2.url, endpoint: endpoints.GetPartsOrQuestionsV2.url,
payload: payload payload: payload
})
.catch(() => {
return {
data: {
partsOrQuestions: []
}
};
}); });
// Flatten location and name properties // Flatten location and name properties
@ -903,7 +910,15 @@ export const useMainStore = defineStore({
method: endpoints.GetPartsOrQuestionsV2.method, method: endpoints.GetPartsOrQuestionsV2.method,
endpoint: endpoints.GetPartsOrQuestionsV2.url, endpoint: endpoints.GetPartsOrQuestionsV2.url,
payload: payload payload: payload
})
.catch(() => {
return {
data: {
partsOrQuestions: []
}
};
}); });
response.data.partsOrQuestions = convertGlassPieceNamingFromApi(response.data.partsOrQuestions); response.data.partsOrQuestions = convertGlassPieceNamingFromApi(response.data.partsOrQuestions);
} }