@open-tender/cloud 0.1.67 → 0.1.68
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.
- package/dist/cjs/app/hooks.d.ts +25 -24
- package/dist/cjs/app/store.d.ts +75 -72
- package/dist/cjs/app/store.js +24 -23
- package/dist/cjs/services/api.d.ts +2 -0
- package/dist/cjs/services/api.js +6 -0
- package/dist/cjs/slices/allergens.d.ts +25 -24
- package/dist/cjs/slices/config.d.ts +25 -24
- package/dist/cjs/slices/customer/order.d.ts +25 -24
- package/dist/cjs/slices/customer/thanx.js +1 -2
- package/dist/cjs/slices/deals.d.ts +4 -4
- package/dist/cjs/slices/deals.js +6 -6
- package/dist/cjs/slices/index.d.ts +1 -0
- package/dist/cjs/slices/index.js +1 -0
- package/dist/cjs/slices/order.d.ts +75 -72
- package/dist/cjs/slices/pointsShop.d.ts +34 -0
- package/dist/cjs/slices/pointsShop.js +77 -0
- package/dist/cjs/slices/tags.d.ts +25 -24
- package/dist/cjs/slices/types.d.ts +1 -0
- package/dist/cjs/slices/types.js +1 -0
- package/dist/esm/app/hooks.d.ts +25 -24
- package/dist/esm/app/store.d.ts +75 -72
- package/dist/esm/app/store.js +25 -24
- package/dist/esm/services/api.d.ts +2 -0
- package/dist/esm/services/api.js +6 -0
- package/dist/esm/slices/allergens.d.ts +25 -24
- package/dist/esm/slices/config.d.ts +25 -24
- package/dist/esm/slices/customer/order.d.ts +25 -24
- package/dist/esm/slices/customer/thanx.js +1 -2
- package/dist/esm/slices/deals.d.ts +4 -4
- package/dist/esm/slices/deals.js +5 -5
- package/dist/esm/slices/index.d.ts +1 -0
- package/dist/esm/slices/index.js +1 -0
- package/dist/esm/slices/order.d.ts +75 -72
- package/dist/esm/slices/pointsShop.d.ts +34 -0
- package/dist/esm/slices/pointsShop.js +73 -0
- package/dist/esm/slices/tags.d.ts +25 -24
- package/dist/esm/slices/types.d.ts +1 -0
- package/dist/esm/slices/types.js +1 -0
- package/package.json +4 -2
package/dist/cjs/slices/deals.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.dealsReducer = exports.selectEligibleDeals = exports.selectDeals = exports.setSelectedDeals = exports.resetDeals = exports.fetchDeals = exports.
|
|
4
|
+
exports.dealsReducer = exports.selectEligibleDeals = exports.selectDeals = exports.setSelectedDeals = exports.resetDeals = exports.fetchDeals = exports.DealsActionType = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const types_1 = require("./types");
|
|
@@ -12,11 +12,11 @@ const initialState = {
|
|
|
12
12
|
error: null,
|
|
13
13
|
loading: 'idle'
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
(function (
|
|
17
|
-
|
|
18
|
-
})(
|
|
19
|
-
exports.fetchDeals = (0, toolkit_1.createAsyncThunk)(
|
|
15
|
+
var DealsActionType;
|
|
16
|
+
(function (DealsActionType) {
|
|
17
|
+
DealsActionType["FetchDeals"] = "deals/fetchDeals";
|
|
18
|
+
})(DealsActionType = exports.DealsActionType || (exports.DealsActionType = {}));
|
|
19
|
+
exports.fetchDeals = (0, toolkit_1.createAsyncThunk)(DealsActionType.FetchDeals, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
20
|
const { api } = getState().config;
|
|
21
21
|
if (!api)
|
|
22
22
|
return;
|
package/dist/cjs/slices/index.js
CHANGED
|
@@ -28,6 +28,7 @@ tslib_1.__exportStar(require("./oneTimePasscode"), exports);
|
|
|
28
28
|
tslib_1.__exportStar(require("./order"), exports);
|
|
29
29
|
tslib_1.__exportStar(require("./orderFulfillment"), exports);
|
|
30
30
|
tslib_1.__exportStar(require("./orderRating"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./pointsShop"), exports);
|
|
31
32
|
tslib_1.__exportStar(require("./posts"), exports);
|
|
32
33
|
tslib_1.__exportStar(require("./qr"), exports);
|
|
33
34
|
tslib_1.__exportStar(require("./resetPassword"), exports);
|
|
@@ -120,9 +120,12 @@ export declare const selectCartCounts: (state: AppState) => CartCounts;
|
|
|
120
120
|
export declare const selectCanOrder: (state: AppState) => RequestedAt | null;
|
|
121
121
|
export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
122
122
|
alerts: import("@open-tender/types").Alerts;
|
|
123
|
-
notifications: import("@open-tender/types").Notifications;
|
|
124
123
|
allergens: import("./allergens").AllergensState;
|
|
125
124
|
announcements: import("./announcements").AnnouncementsState;
|
|
125
|
+
checkout: import("./checkout").CheckoutState;
|
|
126
|
+
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
127
|
+
config: import("./config").ConfigState;
|
|
128
|
+
confirmation: import("./confirmation").ConfirmationState;
|
|
126
129
|
customer: import("redux").CombinedState<{
|
|
127
130
|
account: import("./customer").AccountState;
|
|
128
131
|
allergens: import("./customer").CustomerAllergensState;
|
|
@@ -142,38 +145,36 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
142
145
|
thanx: import("./customer").CustomerThanxState;
|
|
143
146
|
tpls: import("./customer").CustomerTplsState;
|
|
144
147
|
}>;
|
|
145
|
-
|
|
146
|
-
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
147
|
-
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
148
|
-
checkout: import("./checkout").CheckoutState;
|
|
149
|
-
order: OrderState;
|
|
150
|
-
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
151
|
-
orderRating: import("./orderRating").OrderRatingState;
|
|
152
|
-
deals: import("./deals").DealState;
|
|
153
|
-
confirmation: import("./confirmation").ConfirmationState;
|
|
148
|
+
deals: import("./deals").DealsState;
|
|
154
149
|
donations: import("./donations").DonationState;
|
|
155
|
-
|
|
156
|
-
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
157
|
-
menu: import("./menu").MenuState;
|
|
158
|
-
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
159
|
-
validTimes: import("./validTimes").ValidTimesState;
|
|
160
|
-
menuItems: import("./menuItems").MenuItemsState;
|
|
161
|
-
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
150
|
+
geolocation: import("./geolocation").GeoLocationState;
|
|
162
151
|
giftCards: import("./giftCards").GiftCardsState;
|
|
163
152
|
groupOrder: import("./groupOrder").GroupOrderState;
|
|
164
|
-
|
|
165
|
-
geolocation: import("./geolocation").GeoLocationState;
|
|
153
|
+
guest: import("./guest").GuestState;
|
|
166
154
|
loader: import("./loader").LoaderState;
|
|
167
|
-
|
|
168
|
-
|
|
155
|
+
menu: import("./menu").MenuState;
|
|
156
|
+
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
157
|
+
menuItems: import("./menuItems").MenuItemsState;
|
|
169
158
|
modal: Modal;
|
|
170
|
-
|
|
159
|
+
misc: import("./misc").MiscState;
|
|
171
160
|
nav: import("./nav").NavState;
|
|
161
|
+
navSite: import("./navSite").NavSiteState;
|
|
162
|
+
notifications: import("@open-tender/types").Notifications;
|
|
163
|
+
oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
|
|
164
|
+
order: OrderState;
|
|
165
|
+
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
166
|
+
orderRating: import("./orderRating").OrderRatingState;
|
|
167
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
172
168
|
posts: import("./posts").PostsSlice;
|
|
173
|
-
|
|
169
|
+
qr: import("./qr").QrState;
|
|
170
|
+
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
171
|
+
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
174
172
|
sidebar: import("./sidebar").SidebarState;
|
|
173
|
+
sidebarModal: import("./sidebarModal").SidebarModalState;
|
|
174
|
+
signUp: import("./signUp").SignUpState;
|
|
175
175
|
tags: import("./tags").TagsState;
|
|
176
|
-
|
|
176
|
+
validTimes: import("./validTimes").ValidTimesState;
|
|
177
|
+
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
177
178
|
}) => {
|
|
178
179
|
orderMinimum: number | null;
|
|
179
180
|
orderMaximum: number | null;
|
|
@@ -192,9 +193,12 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
192
193
|
};
|
|
193
194
|
export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
194
195
|
alerts: import("@open-tender/types").Alerts;
|
|
195
|
-
notifications: import("@open-tender/types").Notifications;
|
|
196
196
|
allergens: import("./allergens").AllergensState;
|
|
197
197
|
announcements: import("./announcements").AnnouncementsState;
|
|
198
|
+
checkout: import("./checkout").CheckoutState;
|
|
199
|
+
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
200
|
+
config: import("./config").ConfigState;
|
|
201
|
+
confirmation: import("./confirmation").ConfirmationState;
|
|
198
202
|
customer: import("redux").CombinedState<{
|
|
199
203
|
account: import("./customer").AccountState;
|
|
200
204
|
allergens: import("./customer").CustomerAllergensState;
|
|
@@ -214,38 +218,36 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
214
218
|
thanx: import("./customer").CustomerThanxState;
|
|
215
219
|
tpls: import("./customer").CustomerTplsState;
|
|
216
220
|
}>;
|
|
217
|
-
|
|
218
|
-
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
219
|
-
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
220
|
-
checkout: import("./checkout").CheckoutState;
|
|
221
|
-
order: OrderState;
|
|
222
|
-
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
223
|
-
orderRating: import("./orderRating").OrderRatingState;
|
|
224
|
-
deals: import("./deals").DealState;
|
|
225
|
-
confirmation: import("./confirmation").ConfirmationState;
|
|
221
|
+
deals: import("./deals").DealsState;
|
|
226
222
|
donations: import("./donations").DonationState;
|
|
227
|
-
|
|
228
|
-
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
229
|
-
menu: import("./menu").MenuState;
|
|
230
|
-
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
231
|
-
validTimes: import("./validTimes").ValidTimesState;
|
|
232
|
-
menuItems: import("./menuItems").MenuItemsState;
|
|
233
|
-
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
223
|
+
geolocation: import("./geolocation").GeoLocationState;
|
|
234
224
|
giftCards: import("./giftCards").GiftCardsState;
|
|
235
225
|
groupOrder: import("./groupOrder").GroupOrderState;
|
|
236
|
-
|
|
237
|
-
geolocation: import("./geolocation").GeoLocationState;
|
|
226
|
+
guest: import("./guest").GuestState;
|
|
238
227
|
loader: import("./loader").LoaderState;
|
|
239
|
-
|
|
240
|
-
|
|
228
|
+
menu: import("./menu").MenuState;
|
|
229
|
+
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
230
|
+
menuItems: import("./menuItems").MenuItemsState;
|
|
241
231
|
modal: Modal;
|
|
242
|
-
|
|
232
|
+
misc: import("./misc").MiscState;
|
|
243
233
|
nav: import("./nav").NavState;
|
|
234
|
+
navSite: import("./navSite").NavSiteState;
|
|
235
|
+
notifications: import("@open-tender/types").Notifications;
|
|
236
|
+
oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
|
|
237
|
+
order: OrderState;
|
|
238
|
+
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
239
|
+
orderRating: import("./orderRating").OrderRatingState;
|
|
240
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
244
241
|
posts: import("./posts").PostsSlice;
|
|
245
|
-
|
|
242
|
+
qr: import("./qr").QrState;
|
|
243
|
+
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
244
|
+
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
246
245
|
sidebar: import("./sidebar").SidebarState;
|
|
246
|
+
sidebarModal: import("./sidebarModal").SidebarModalState;
|
|
247
|
+
signUp: import("./signUp").SignUpState;
|
|
247
248
|
tags: import("./tags").TagsState;
|
|
248
|
-
|
|
249
|
+
validTimes: import("./validTimes").ValidTimesState;
|
|
250
|
+
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
249
251
|
}) => number[]) & import("reselect").OutputSelectorFields<(args_0: Cart | null) => number[], {
|
|
250
252
|
clearCache: () => void;
|
|
251
253
|
}> & {
|
|
@@ -259,9 +261,12 @@ export declare const selectMessages: (state: AppState) => Messages;
|
|
|
259
261
|
export declare const selectCurrentItem: (state: AppState) => CartItem | null;
|
|
260
262
|
export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
261
263
|
alerts: import("@open-tender/types").Alerts;
|
|
262
|
-
notifications: import("@open-tender/types").Notifications;
|
|
263
264
|
allergens: import("./allergens").AllergensState;
|
|
264
265
|
announcements: import("./announcements").AnnouncementsState;
|
|
266
|
+
checkout: import("./checkout").CheckoutState;
|
|
267
|
+
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
268
|
+
config: import("./config").ConfigState;
|
|
269
|
+
confirmation: import("./confirmation").ConfirmationState;
|
|
265
270
|
customer: import("redux").CombinedState<{
|
|
266
271
|
account: import("./customer").AccountState;
|
|
267
272
|
allergens: import("./customer").CustomerAllergensState;
|
|
@@ -281,38 +286,36 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
281
286
|
thanx: import("./customer").CustomerThanxState;
|
|
282
287
|
tpls: import("./customer").CustomerTplsState;
|
|
283
288
|
}>;
|
|
284
|
-
|
|
285
|
-
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
286
|
-
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
287
|
-
checkout: import("./checkout").CheckoutState;
|
|
288
|
-
order: OrderState;
|
|
289
|
-
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
290
|
-
orderRating: import("./orderRating").OrderRatingState;
|
|
291
|
-
deals: import("./deals").DealState;
|
|
292
|
-
confirmation: import("./confirmation").ConfirmationState;
|
|
289
|
+
deals: import("./deals").DealsState;
|
|
293
290
|
donations: import("./donations").DonationState;
|
|
294
|
-
|
|
295
|
-
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
296
|
-
menu: import("./menu").MenuState;
|
|
297
|
-
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
298
|
-
validTimes: import("./validTimes").ValidTimesState;
|
|
299
|
-
menuItems: import("./menuItems").MenuItemsState;
|
|
300
|
-
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
291
|
+
geolocation: import("./geolocation").GeoLocationState;
|
|
301
292
|
giftCards: import("./giftCards").GiftCardsState;
|
|
302
293
|
groupOrder: import("./groupOrder").GroupOrderState;
|
|
303
|
-
|
|
304
|
-
geolocation: import("./geolocation").GeoLocationState;
|
|
294
|
+
guest: import("./guest").GuestState;
|
|
305
295
|
loader: import("./loader").LoaderState;
|
|
306
|
-
|
|
307
|
-
|
|
296
|
+
menu: import("./menu").MenuState;
|
|
297
|
+
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
298
|
+
menuItems: import("./menuItems").MenuItemsState;
|
|
308
299
|
modal: Modal;
|
|
309
|
-
|
|
300
|
+
misc: import("./misc").MiscState;
|
|
310
301
|
nav: import("./nav").NavState;
|
|
302
|
+
navSite: import("./navSite").NavSiteState;
|
|
303
|
+
notifications: import("@open-tender/types").Notifications;
|
|
304
|
+
oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
|
|
305
|
+
order: OrderState;
|
|
306
|
+
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
307
|
+
orderRating: import("./orderRating").OrderRatingState;
|
|
308
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
311
309
|
posts: import("./posts").PostsSlice;
|
|
312
|
-
|
|
310
|
+
qr: import("./qr").QrState;
|
|
311
|
+
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
312
|
+
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
313
313
|
sidebar: import("./sidebar").SidebarState;
|
|
314
|
+
sidebarModal: import("./sidebarModal").SidebarModalState;
|
|
315
|
+
signUp: import("./signUp").SignUpState;
|
|
314
316
|
tags: import("./tags").TagsState;
|
|
315
|
-
|
|
317
|
+
validTimes: import("./validTimes").ValidTimesState;
|
|
318
|
+
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
316
319
|
}) => {
|
|
317
320
|
revenueCenterId: number | null;
|
|
318
321
|
serviceType: ServiceType | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AppState } from '../app';
|
|
2
|
+
import { RequestError, RequestStatus, TPLSPointsShopRewards } from '@open-tender/types';
|
|
3
|
+
export interface PointsShopState {
|
|
4
|
+
entities: TPLSPointsShopRewards;
|
|
5
|
+
error: RequestError;
|
|
6
|
+
loading: RequestStatus;
|
|
7
|
+
}
|
|
8
|
+
export declare enum PointsShopActionType {
|
|
9
|
+
FetchPointsShop = "pointsShop/fetchPointsShop",
|
|
10
|
+
ExchangePointsShopReward = "pointsShop/exchangePointsShopReward"
|
|
11
|
+
}
|
|
12
|
+
export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<TPLSPointsShopRewards, void, {
|
|
13
|
+
state: AppState;
|
|
14
|
+
rejectValue: RequestError;
|
|
15
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
16
|
+
extra?: unknown;
|
|
17
|
+
serializedErrorType?: unknown;
|
|
18
|
+
pendingMeta?: unknown;
|
|
19
|
+
fulfilledMeta?: unknown;
|
|
20
|
+
rejectedMeta?: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<TPLSPointsShopRewards, string, {
|
|
23
|
+
state: AppState;
|
|
24
|
+
rejectValue: RequestError;
|
|
25
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
26
|
+
extra?: unknown;
|
|
27
|
+
serializedErrorType?: unknown;
|
|
28
|
+
pendingMeta?: unknown;
|
|
29
|
+
fulfilledMeta?: unknown;
|
|
30
|
+
rejectedMeta?: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const resetPointsShop: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"pointsShop/resetPointsShop">;
|
|
33
|
+
export declare const selectPointsShop: (state: AppState) => PointsShopState;
|
|
34
|
+
export declare const pointsShopReducer: import("redux").Reducer<PointsShopState, import("redux").AnyAction>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pointsShopReducer = exports.selectPointsShop = exports.resetPointsShop = exports.exchangePointsShopReward = exports.fetchPointsShop = exports.PointsShopActionType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const types_1 = require("./types");
|
|
7
|
+
const initialState = {
|
|
8
|
+
entities: [],
|
|
9
|
+
error: null,
|
|
10
|
+
loading: 'idle'
|
|
11
|
+
};
|
|
12
|
+
var PointsShopActionType;
|
|
13
|
+
(function (PointsShopActionType) {
|
|
14
|
+
PointsShopActionType["FetchPointsShop"] = "pointsShop/fetchPointsShop";
|
|
15
|
+
PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
|
|
16
|
+
})(PointsShopActionType = exports.PointsShopActionType || (exports.PointsShopActionType = {}));
|
|
17
|
+
exports.fetchPointsShop = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const { api } = getState().config;
|
|
19
|
+
if (!api)
|
|
20
|
+
return;
|
|
21
|
+
try {
|
|
22
|
+
return yield api.getPointsShop();
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return rejectWithValue(err);
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
exports.exchangePointsShopReward = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const { api } = getState().config;
|
|
30
|
+
if (!api)
|
|
31
|
+
return;
|
|
32
|
+
try {
|
|
33
|
+
yield api.postPointsShopReward(rewardId);
|
|
34
|
+
return yield api.getPointsShop();
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return rejectWithValue(err);
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
const pointsShopSlice = (0, toolkit_1.createSlice)({
|
|
41
|
+
name: types_1.ReducerType.PointsShop,
|
|
42
|
+
initialState,
|
|
43
|
+
reducers: {
|
|
44
|
+
resetPointsShop: () => initialState
|
|
45
|
+
},
|
|
46
|
+
extraReducers: builder => {
|
|
47
|
+
builder
|
|
48
|
+
.addCase(exports.fetchPointsShop.fulfilled, (state, action) => {
|
|
49
|
+
state.entities = action.payload;
|
|
50
|
+
state.loading = 'idle';
|
|
51
|
+
state.error = null;
|
|
52
|
+
})
|
|
53
|
+
.addCase(exports.fetchPointsShop.pending, state => {
|
|
54
|
+
state.loading = 'pending';
|
|
55
|
+
})
|
|
56
|
+
.addCase(exports.fetchPointsShop.rejected, (state, action) => {
|
|
57
|
+
state.error = action.payload;
|
|
58
|
+
state.loading = 'idle';
|
|
59
|
+
})
|
|
60
|
+
.addCase(exports.exchangePointsShopReward.fulfilled, (state, action) => {
|
|
61
|
+
state.entities = action.payload;
|
|
62
|
+
state.loading = 'idle';
|
|
63
|
+
state.error = null;
|
|
64
|
+
})
|
|
65
|
+
.addCase(exports.exchangePointsShopReward.pending, state => {
|
|
66
|
+
state.loading = 'pending';
|
|
67
|
+
})
|
|
68
|
+
.addCase(exports.exchangePointsShopReward.rejected, (state, action) => {
|
|
69
|
+
state.error = action.payload;
|
|
70
|
+
state.loading = 'idle';
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
exports.resetPointsShop = pointsShopSlice.actions.resetPointsShop;
|
|
75
|
+
const selectPointsShop = (state) => state.pointsShop;
|
|
76
|
+
exports.selectPointsShop = selectPointsShop;
|
|
77
|
+
exports.pointsShopReducer = pointsShopSlice.reducer;
|
|
@@ -29,9 +29,12 @@ export declare const selectTags: (state: AppState) => TagsState;
|
|
|
29
29
|
export declare const selectSelectedTags: (state: AppState) => Tags;
|
|
30
30
|
export declare const selectSelectedTagNames: ((state: import("redux").EmptyObject & {
|
|
31
31
|
alerts: import("@open-tender/types").Alerts;
|
|
32
|
-
notifications: import("@open-tender/types").Notifications;
|
|
33
32
|
allergens: import("./allergens").AllergensState;
|
|
34
33
|
announcements: import("./announcements").AnnouncementsState;
|
|
34
|
+
checkout: import("./checkout").CheckoutState;
|
|
35
|
+
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
36
|
+
config: import("./config").ConfigState;
|
|
37
|
+
confirmation: import("./confirmation").ConfirmationState;
|
|
35
38
|
customer: import("redux").CombinedState<{
|
|
36
39
|
account: import("./customer").AccountState;
|
|
37
40
|
allergens: import("./customer").CustomerAllergensState;
|
|
@@ -51,38 +54,36 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
51
54
|
thanx: import("./customer").CustomerThanxState;
|
|
52
55
|
tpls: import("./customer").CustomerTplsState;
|
|
53
56
|
}>;
|
|
54
|
-
|
|
55
|
-
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
56
|
-
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
57
|
-
checkout: import("./checkout").CheckoutState;
|
|
58
|
-
order: import("./order").OrderState;
|
|
59
|
-
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
60
|
-
orderRating: import("./orderRating").OrderRatingState;
|
|
61
|
-
deals: import("./deals").DealState;
|
|
62
|
-
confirmation: import("./confirmation").ConfirmationState;
|
|
57
|
+
deals: import("./deals").DealsState;
|
|
63
58
|
donations: import("./donations").DonationState;
|
|
64
|
-
|
|
65
|
-
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
66
|
-
menu: import("./menu").MenuState;
|
|
67
|
-
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
68
|
-
validTimes: import("./validTimes").ValidTimesState;
|
|
69
|
-
menuItems: import("./menuItems").MenuItemsState;
|
|
70
|
-
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
59
|
+
geolocation: import("./geolocation").GeoLocationState;
|
|
71
60
|
giftCards: import("./giftCards").GiftCardsState;
|
|
72
61
|
groupOrder: import("./groupOrder").GroupOrderState;
|
|
73
|
-
|
|
74
|
-
geolocation: import("./geolocation").GeoLocationState;
|
|
62
|
+
guest: import("./guest").GuestState;
|
|
75
63
|
loader: import("./loader").LoaderState;
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
menu: import("./menu").MenuState;
|
|
65
|
+
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
66
|
+
menuItems: import("./menuItems").MenuItemsState;
|
|
78
67
|
modal: import("@open-tender/types").Modal;
|
|
79
|
-
|
|
68
|
+
misc: import("./misc").MiscState;
|
|
80
69
|
nav: import("./nav").NavState;
|
|
70
|
+
navSite: import("./navSite").NavSiteState;
|
|
71
|
+
notifications: import("@open-tender/types").Notifications;
|
|
72
|
+
oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
|
|
73
|
+
order: import("./order").OrderState;
|
|
74
|
+
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
75
|
+
orderRating: import("./orderRating").OrderRatingState;
|
|
76
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
81
77
|
posts: import("./posts").PostsSlice;
|
|
82
|
-
|
|
78
|
+
qr: import("./qr").QrState;
|
|
79
|
+
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
80
|
+
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
83
81
|
sidebar: import("./sidebar").SidebarState;
|
|
82
|
+
sidebarModal: import("./sidebarModal").SidebarModalState;
|
|
83
|
+
signUp: import("./signUp").SignUpState;
|
|
84
84
|
tags: TagsState;
|
|
85
|
-
|
|
85
|
+
validTimes: import("./validTimes").ValidTimesState;
|
|
86
|
+
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
86
87
|
}) => string[]) & import("reselect").OutputSelectorFields<(args_0: {
|
|
87
88
|
tags: Tags;
|
|
88
89
|
selectedTags: Tags;
|
package/dist/cjs/slices/types.js
CHANGED
|
@@ -42,6 +42,7 @@ var ReducerType;
|
|
|
42
42
|
ReducerType["OrderRating"] = "orderRating";
|
|
43
43
|
ReducerType["Orders"] = "orders";
|
|
44
44
|
ReducerType["Posts"] = "posts";
|
|
45
|
+
ReducerType["PointsShop"] = "pointsShop";
|
|
45
46
|
ReducerType["Qr"] = "qr";
|
|
46
47
|
ReducerType["QRCode"] = "qrcode";
|
|
47
48
|
ReducerType["ResetPassword"] = "resetPassword";
|
package/dist/esm/app/hooks.d.ts
CHANGED
|
@@ -2,9 +2,12 @@ import { TypedUseSelectorHook } from 'react-redux';
|
|
|
2
2
|
import type { RootState } from './store';
|
|
3
3
|
export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<import("redux").CombinedState<{
|
|
4
4
|
alerts: import("@open-tender/types").Alerts;
|
|
5
|
-
notifications: import("@open-tender/types").Notifications;
|
|
6
5
|
allergens: import("..").AllergensState;
|
|
7
6
|
announcements: import("..").AnnouncementsState;
|
|
7
|
+
checkout: import("..").CheckoutState;
|
|
8
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
9
|
+
config: import("..").ConfigState;
|
|
10
|
+
confirmation: import("..").ConfirmationState;
|
|
8
11
|
customer: import("redux").CombinedState<{
|
|
9
12
|
account: import("..").AccountState;
|
|
10
13
|
allergens: import("..").CustomerAllergensState;
|
|
@@ -24,37 +27,35 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
24
27
|
thanx: import("..").CustomerThanxState;
|
|
25
28
|
tpls: import("..").CustomerTplsState;
|
|
26
29
|
}>;
|
|
27
|
-
|
|
28
|
-
revenueCenters: import("..").RevenueCentersState;
|
|
29
|
-
completedOrders: import("..").CompletedOrdersState;
|
|
30
|
-
checkout: import("..").CheckoutState;
|
|
31
|
-
order: import("..").OrderState;
|
|
32
|
-
orderFulfillment: import("..").OrderFulfillmentState;
|
|
33
|
-
orderRating: import("..").OrderRatingState;
|
|
34
|
-
deals: import("..").DealState;
|
|
35
|
-
confirmation: import("..").ConfirmationState;
|
|
30
|
+
deals: import("..").DealsState;
|
|
36
31
|
donations: import("..").DonationState;
|
|
37
|
-
|
|
38
|
-
verifyAccount: import("..").VerifyAccountState;
|
|
39
|
-
menu: import("..").MenuState;
|
|
40
|
-
resetPassword: import("..").ResetPasswordState;
|
|
41
|
-
validTimes: import("..").ValidTimesState;
|
|
42
|
-
menuItems: import("..").MenuItemsState;
|
|
43
|
-
menuDisplay: import("..").MenuDisplayState;
|
|
32
|
+
geolocation: import("..").GeoLocationState;
|
|
44
33
|
giftCards: import("..").GiftCardsState;
|
|
45
34
|
groupOrder: import("..").GroupOrderState;
|
|
46
|
-
|
|
47
|
-
geolocation: import("..").GeoLocationState;
|
|
35
|
+
guest: import("..").GuestState;
|
|
48
36
|
loader: import("..").LoaderState;
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
menu: import("..").MenuState;
|
|
38
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
39
|
+
menuItems: import("..").MenuItemsState;
|
|
51
40
|
modal: import("@open-tender/types").Modal;
|
|
52
|
-
|
|
41
|
+
misc: import("..").MiscState;
|
|
53
42
|
nav: import("..").NavState;
|
|
43
|
+
navSite: import("..").NavSiteState;
|
|
44
|
+
notifications: import("@open-tender/types").Notifications;
|
|
45
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
46
|
+
order: import("..").OrderState;
|
|
47
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
48
|
+
orderRating: import("..").OrderRatingState;
|
|
49
|
+
pointsShop: import("..").PointsShopState;
|
|
54
50
|
posts: import("..").PostsSlice;
|
|
55
|
-
|
|
51
|
+
qr: import("..").QrState;
|
|
52
|
+
resetPassword: import("..").ResetPasswordState;
|
|
53
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
56
54
|
sidebar: import("..").SidebarState;
|
|
55
|
+
sidebarModal: import("..").SidebarModalState;
|
|
56
|
+
signUp: import("..").SignUpState;
|
|
57
57
|
tags: import("..").TagsState;
|
|
58
|
-
|
|
58
|
+
validTimes: import("..").ValidTimesState;
|
|
59
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
59
60
|
}>, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").Action<any>>;
|
|
60
61
|
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|