@open-tender/cloud
Advanced tools
Comparing version 0.1.94 to 0.1.95
@@ -14,3 +14,2 @@ import { Dispatch } from '@reduxjs/toolkit'; | ||
export declare enum CheckoutActionType { | ||
FetchCheckout = "checkout/fetchCheckout", | ||
ValidateOrder = "checkout/validateOrder", | ||
@@ -17,0 +16,0 @@ SubmitOrder = "checkout/SubmitOrder", |
@@ -33,3 +33,2 @@ "use strict"; | ||
(function (CheckoutActionType) { | ||
CheckoutActionType["FetchCheckout"] = "checkout/fetchCheckout"; | ||
CheckoutActionType["ValidateOrder"] = "checkout/validateOrder"; | ||
@@ -103,3 +102,3 @@ CheckoutActionType["SubmitOrder"] = "checkout/SubmitOrder"; | ||
}; | ||
exports.validateOrder = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.FetchCheckout, (order, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
exports.validateOrder = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.ValidateOrder, (order, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
@@ -106,0 +105,0 @@ const { api } = getState().config; |
@@ -160,3 +160,3 @@ import { AppState } from '../../app'; | ||
}) => import("@open-tender/types").CustomerLoyalty | null) & import("reselect").OutputSelectorFields<(args_0: { | ||
loyalty: CustomerLoyaltyState; | ||
loyaltyPrograms: CustomerLoyalties; | ||
}) => import("@open-tender/types").CustomerLoyalty | null, { | ||
@@ -163,0 +163,0 @@ clearCache: () => void; |
@@ -78,7 +78,8 @@ "use strict"; | ||
const { loyalty } = state.customer; | ||
return { loyalty }; | ||
}, ({ loyalty }) => { | ||
if (!loyalty) | ||
const { entities: loyaltyPrograms } = loyalty; | ||
return { loyaltyPrograms }; | ||
}, ({ loyaltyPrograms }) => { | ||
if (!loyaltyPrograms) | ||
return null; | ||
const programs = loyalty.entities.filter(i => i.loyalty_type === 'POINTS' && | ||
const programs = loyaltyPrograms.filter(i => i.loyalty_type === 'POINTS' && | ||
(i.spend.order_type === null || i.spend.order_type === orderType)); | ||
@@ -85,0 +86,0 @@ return programs.length ? programs[0] : null; |
@@ -14,3 +14,2 @@ import { Dispatch } from '@reduxjs/toolkit'; | ||
export declare enum CheckoutActionType { | ||
FetchCheckout = "checkout/fetchCheckout", | ||
ValidateOrder = "checkout/validateOrder", | ||
@@ -17,0 +16,0 @@ SubmitOrder = "checkout/SubmitOrder", |
@@ -29,3 +29,2 @@ import { __awaiter } from "tslib"; | ||
(function (CheckoutActionType) { | ||
CheckoutActionType["FetchCheckout"] = "checkout/fetchCheckout"; | ||
CheckoutActionType["ValidateOrder"] = "checkout/validateOrder"; | ||
@@ -99,3 +98,3 @@ CheckoutActionType["SubmitOrder"] = "checkout/SubmitOrder"; | ||
}; | ||
export const validateOrder = createAsyncThunk(CheckoutActionType.FetchCheckout, (order, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () { | ||
export const validateOrder = createAsyncThunk(CheckoutActionType.ValidateOrder, (order, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
@@ -102,0 +101,0 @@ const { api } = getState().config; |
@@ -160,3 +160,3 @@ import { AppState } from '../../app'; | ||
}) => import("@open-tender/types").CustomerLoyalty | null) & import("reselect").OutputSelectorFields<(args_0: { | ||
loyalty: CustomerLoyaltyState; | ||
loyaltyPrograms: CustomerLoyalties; | ||
}) => import("@open-tender/types").CustomerLoyalty | null, { | ||
@@ -163,0 +163,0 @@ clearCache: () => void; |
@@ -73,7 +73,8 @@ import { __awaiter } from "tslib"; | ||
const { loyalty } = state.customer; | ||
return { loyalty }; | ||
}, ({ loyalty }) => { | ||
if (!loyalty) | ||
const { entities: loyaltyPrograms } = loyalty; | ||
return { loyaltyPrograms }; | ||
}, ({ loyaltyPrograms }) => { | ||
if (!loyaltyPrograms) | ||
return null; | ||
const programs = loyalty.entities.filter(i => i.loyalty_type === 'POINTS' && | ||
const programs = loyaltyPrograms.filter(i => i.loyalty_type === 'POINTS' && | ||
(i.spend.order_type === null || i.spend.order_type === orderType)); | ||
@@ -80,0 +81,0 @@ return programs.length ? programs[0] : null; |
{ | ||
"name": "@open-tender/cloud", | ||
"version": "0.1.94", | ||
"version": "0.1.95", | ||
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
911477
20620