@open-tender/cloud 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,5 +15,5 @@ export declare const fetchAllergens: import("@reduxjs/toolkit").AsyncThunk<Aller
15
15
  }>;
16
16
  export declare const resetAllergens: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setSelectedAllergens: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
17
17
  export declare const selectAllergens: (state: AppState) => AllergensState;
18
- export declare const selectSelectedAllergenNames: (state: AppState) => (string | undefined)[];
18
+ export declare const selectSelectedAllergenNames: (state: AppState) => string[];
19
19
  export declare const allergensReducer: import("redux").Reducer<AllergensState, import("redux").AnyAction>;
@@ -58,8 +58,9 @@ const selectSelectedAllergenNames = (state) => {
58
58
  return [];
59
59
  }
60
60
  return selectedAllergens.map(i => {
61
+ var _a;
61
62
  const allergen = allergens.find(a => a.allergen_id === i.allergen_id);
62
- return allergen ? allergen.name : '';
63
+ return allergen ? (_a = allergen.name) !== null && _a !== void 0 ? _a : '' : '';
63
64
  });
64
65
  };
65
66
  exports.selectSelectedAllergenNames = selectSelectedAllergenNames;
@@ -24,4 +24,5 @@ export declare const selectCustomerLoyaltyProgram: (state: AppState) => {
24
24
  };
25
25
  export declare const selectCustomerPointsProgram: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
26
26
  export declare const selectCustomerPoints: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").LoyaltyPoints | null;
27
+ export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
27
28
  export declare const customerLoyaltyReducer: import("redux").Reducer<CustomerLoyaltyState, import("redux").AnyAction>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.customerLoyaltyReducer = exports.selectCustomerPoints = exports.selectCustomerPointsProgram = exports.selectCustomerLoyaltyProgram = exports.selectCustomerLoyalty = exports.setCustomerLoyalty = exports.resetCustomerLoyaltyError = exports.resetCustomerLoyalty = exports.fetchCustomerLoyalty = exports.CustomerLoyaltyActionType = void 0;
4
+ exports.customerLoyaltyReducer = exports.selectPointsProgram = exports.selectCustomerPoints = exports.selectCustomerPointsProgram = exports.selectCustomerLoyaltyProgram = exports.selectCustomerLoyalty = exports.setCustomerLoyalty = exports.resetCustomerLoyaltyError = exports.resetCustomerLoyalty = exports.fetchCustomerLoyalty = exports.CustomerLoyaltyActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const types_1 = require("../types");
@@ -84,4 +84,9 @@ const selectCustomerPoints = (orderType) => (state) => {
84
84
  return program ? program.points : null;
85
85
  };
86
86
  exports.selectCustomerPoints = selectCustomerPoints;
87
+ const selectPointsProgram = (state) => {
88
+ const { orderType } = state.order;
89
+ return orderType ? (0, exports.selectCustomerPointsProgram)(orderType)(state) : null;
90
+ };
91
+ exports.selectPointsProgram = selectPointsProgram;
87
92
  exports.customerLoyaltyReducer = customerLoyaltySlice.reducer;
@@ -15,5 +15,5 @@ export declare const fetchAllergens: import("@reduxjs/toolkit").AsyncThunk<Aller
15
15
  }>;
16
16
  export declare const resetAllergens: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setSelectedAllergens: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
17
17
  export declare const selectAllergens: (state: AppState) => AllergensState;
18
- export declare const selectSelectedAllergenNames: (state: AppState) => (string | undefined)[];
18
+ export declare const selectSelectedAllergenNames: (state: AppState) => string[];
19
19
  export declare const allergensReducer: import("redux").Reducer<AllergensState, import("redux").AnyAction>;
@@ -53,8 +53,9 @@ export const selectSelectedAllergenNames = (state) => {
53
53
  return [];
54
54
  }
55
55
  return selectedAllergens.map(i => {
56
+ var _a;
56
57
  const allergen = allergens.find(a => a.allergen_id === i.allergen_id);
57
- return allergen ? allergen.name : '';
58
+ return allergen ? (_a = allergen.name) !== null && _a !== void 0 ? _a : '' : '';
58
59
  });
59
60
  };
60
61
  export const allergensReducer = allergensSlice.reducer;
@@ -24,4 +24,5 @@ export declare const selectCustomerLoyaltyProgram: (state: AppState) => {
24
24
  };
25
25
  export declare const selectCustomerPointsProgram: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
26
26
  export declare const selectCustomerPoints: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").LoyaltyPoints | null;
27
+ export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
27
28
  export declare const customerLoyaltyReducer: import("redux").Reducer<CustomerLoyaltyState, import("redux").AnyAction>;
@@ -76,4 +76,8 @@ export const selectCustomerPoints = (orderType) => (state) => {
76
76
  const program = selectCustomerPointsProgram(orderType)(state);
77
77
  return program ? program.points : null;
78
78
  };
79
+ export const selectPointsProgram = (state) => {
80
+ const { orderType } = state.order;
81
+ return orderType ? selectCustomerPointsProgram(orderType)(state) : null;
82
+ };
79
83
  export const customerLoyaltyReducer = customerLoyaltySlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",