vanilli-shop-client
Advanced tools
Comparing version 1.5.9 to 1.6.0
@@ -65,3 +65,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var rootStore, notificationStore, translationStore, request, result, data, e_1; | ||
var rootStore, notificationStore, translationStore, shippingStore, selectedMethod, request, result, data, e_1; | ||
return __generator(this, function (_a) { | ||
@@ -77,6 +77,16 @@ switch (_a.label) { | ||
} | ||
if (!rootStore.shippingStore.selectedMethod) { | ||
shippingStore = rootStore.shippingStore; | ||
selectedMethod = shippingStore.selectedMethod; | ||
if (!selectedMethod) { | ||
notificationStore.notifyError(translationStore.t("order.choose-shipping-method", "Palun valige tarneviis")); | ||
return [2 /*return*/, undefined]; | ||
} | ||
if (selectedMethod) { | ||
if (selectedMethod.provider) { | ||
if (!shippingStore.selectedPickupPoint) { | ||
notificationStore.notifyError(translationStore.t("order.choose-pickup-point", "Palun valige pakiautomaat")); | ||
return [2 /*return*/, undefined]; | ||
} | ||
} | ||
} | ||
if (!rootStore.companyStore.selectedPaymentProvider) { | ||
@@ -83,0 +93,0 @@ notificationStore.notifyError(translationStore.t("order.choose-payment-method", "Palun valige maksemeetod")); |
{ | ||
"name": "vanilli-shop-client", | ||
"version": "1.5.9", | ||
"version": "1.6.0", | ||
"description": "Client for Vanilli Shop API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,3 +15,6 @@ import BaseStore from "./base-store"; | ||
if (!rootStore.shippingStore.selectedMethod) { | ||
const shippingStore = rootStore.shippingStore; | ||
const selectedMethod = shippingStore.selectedMethod; | ||
if (!selectedMethod) { | ||
notificationStore.notifyError(translationStore.t("order.choose-shipping-method", "Palun valige tarneviis")); | ||
@@ -21,2 +24,11 @@ return undefined; | ||
if (selectedMethod) { | ||
if (selectedMethod.provider) { | ||
if (!shippingStore.selectedPickupPoint) { | ||
notificationStore.notifyError(translationStore.t("order.choose-pickup-point", "Palun valige pakiautomaat")); | ||
return undefined; | ||
} | ||
} | ||
} | ||
if (!rootStore.companyStore.selectedPaymentProvider) { | ||
@@ -23,0 +35,0 @@ notificationStore.notifyError(translationStore.t("order.choose-payment-method", "Palun valige maksemeetod")); |
265817
5887