Merge pull request #2378 from Safelite/Feature/Digital/CASH-134
CASH-134
This commit is contained in:
commit
e431afe580
1 changed files with 22 additions and 10 deletions
|
|
@ -526,17 +526,9 @@ export default {
|
|||
// try to call API to add donation to order
|
||||
|
||||
// TEMP DUMMY CALL TO SIMULATE SUCCESS OR ERROR FROM API CALL
|
||||
// TO BE REPLACED BY REAL CALL LATER
|
||||
const donationResponse = await this.dispatchStoreActionWithLogging(
|
||||
storeActions.LOOKUP_VIN_BY_PLATE,
|
||||
{ licensePlate: plateTemp, licenseState: "OH" },
|
||||
"test",
|
||||
false
|
||||
).catch((error) => {
|
||||
return error;
|
||||
});
|
||||
const donationResponse = this.createMockedResponse(amount);
|
||||
|
||||
if (donationResponse?.status == "200") {
|
||||
if (donationResponse?.wasSuccessful) {
|
||||
this.showDonationSuccess = true;
|
||||
this.showDonationError = false;
|
||||
const donationResponse = await baseMixin.methods.dispatchStoreAction(
|
||||
|
|
@ -554,6 +546,26 @@ export default {
|
|||
);
|
||||
}
|
||||
},
|
||||
//mocked response. should be removed once integrate with actual api call.
|
||||
createMockedResponse(amount) {
|
||||
let result;
|
||||
|
||||
switch (amount) {
|
||||
case 1:
|
||||
result = { wasSuccessful: true, wasLocked: false };
|
||||
break;
|
||||
case 3:
|
||||
result = { wasSuccessful: false, wasLocked: true };
|
||||
break;
|
||||
case 5:
|
||||
result = { wasSuccessful: false, wasLocked: false };
|
||||
break;
|
||||
default:
|
||||
result = { wasSuccessful: null, wasLocked: null }; // Default case if amount doesn't match
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
donationAmount(newValue) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue