@open-tender/cloud 0.4.5 → 0.4.7
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/services/api.d.ts +1 -0
- package/dist/cjs/services/api.js +3 -0
- package/dist/cjs/slices/config.d.ts +67 -0
- package/dist/cjs/slices/config.js +15 -1
- package/dist/cjs/slices/customer/tpls.d.ts +10 -0
- package/dist/cjs/slices/customer/tpls.js +21 -1
- package/dist/esm/services/api.d.ts +1 -0
- package/dist/esm/services/api.js +3 -0
- package/dist/esm/slices/config.d.ts +67 -0
- package/dist/esm/slices/config.js +13 -0
- package/dist/esm/slices/customer/tpls.d.ts +10 -0
- package/dist/esm/slices/customer/tpls.js +20 -0
- package/package.json +2 -2
|
@@ -160,6 +160,7 @@ declare class OpenTenderAPI {
|
|
|
160
160
|
getCustomerLoyaltyV2(token: string): Promise<unknown>;
|
|
161
161
|
getCustomerThanx(token: string): Promise<unknown>;
|
|
162
162
|
getThanxCardSignature(token: string, acct: string): Promise<unknown>;
|
|
163
|
+
postCustomerTplsVerify(): Promise<unknown>;
|
|
163
164
|
getCustomerTpls(token: string): Promise<unknown>;
|
|
164
165
|
getCustomerTplsHistory(token: string): Promise<unknown>;
|
|
165
166
|
getCustomerHouseAccounts(token: string): Promise<unknown>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -696,6 +696,9 @@ class OpenTenderAPI {
|
|
|
696
696
|
getThanxCardSignature(token, acct) {
|
|
697
697
|
return this.request(`/customer/thanx-card-signature?acct=${acct}`, 'GET', null, null, token);
|
|
698
698
|
}
|
|
699
|
+
postCustomerTplsVerify() {
|
|
700
|
+
return this.request(`/customer/tpls/email-verify`, 'POST', {});
|
|
701
|
+
}
|
|
699
702
|
getCustomerTpls(token) {
|
|
700
703
|
return this.request(`/customer/tpls`, 'GET', null, null, token);
|
|
701
704
|
}
|
|
@@ -166,6 +166,73 @@ export declare const selectFulfillment: (state: AppState) => import("@open-tende
|
|
|
166
166
|
export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined;
|
|
167
167
|
export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined;
|
|
168
168
|
export declare const selectPage: (page: ConfigPageType) => (state: AppState) => ConfigPage | undefined;
|
|
169
|
+
export declare const selectBottomTabsDisplayed: (state: AppState) => import("@open-tender/types").BottomTabsSections;
|
|
170
|
+
export declare const selectBottomTabsTitles: ((state: import("redux").EmptyObject & {
|
|
171
|
+
alerts: import("@open-tender/types").Alerts;
|
|
172
|
+
allergens: import("./allergens").AllergensState;
|
|
173
|
+
announcements: import("./announcements").AnnouncementsState;
|
|
174
|
+
checkout: import("./checkout").CheckoutState;
|
|
175
|
+
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
176
|
+
config: ConfigState;
|
|
177
|
+
confirmation: import("./confirmation").ConfirmationState;
|
|
178
|
+
customer: import("redux").CombinedState<{
|
|
179
|
+
account: import("./customer").AccountState;
|
|
180
|
+
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
181
|
+
creditCards: import("./customer").CustomerCreditCardsState;
|
|
182
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
183
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
184
|
+
favorites: import("./customer").CustomerFavoritesState;
|
|
185
|
+
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
186
|
+
giftCards: import("./customer").CustomerGiftCardsState;
|
|
187
|
+
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
188
|
+
history: import("./customer").CustomerHistoryState;
|
|
189
|
+
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
190
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
191
|
+
order: import("./customer").CustomerOrderState;
|
|
192
|
+
orders: import("./customer").CustomerOrdersState;
|
|
193
|
+
pointsShop: import("./customer").PointsShopState;
|
|
194
|
+
qrcode: import("./customer").CustomerQRCodeState;
|
|
195
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
196
|
+
thanx: import("./customer").CustomerThanxState;
|
|
197
|
+
tpls: import("./customer").CustomerTplsState;
|
|
198
|
+
}>;
|
|
199
|
+
deals: import("./deals").DealsState;
|
|
200
|
+
donations: import("./donations").DonationState;
|
|
201
|
+
geolocation: import("./geolocation").GeoLocationState;
|
|
202
|
+
giftCards: import("./giftCards").GiftCardsState;
|
|
203
|
+
groupOrder: import("./groupOrder").GroupOrderState;
|
|
204
|
+
guest: import("./guest").GuestState;
|
|
205
|
+
loader: import("./loader").LoaderState;
|
|
206
|
+
menu: import("./menu").MenuState;
|
|
207
|
+
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
208
|
+
menuItems: import("./menuItems").MenuItemsState;
|
|
209
|
+
modal: import("@open-tender/types").Modal;
|
|
210
|
+
misc: import("./misc").MiscState;
|
|
211
|
+
nav: import("./nav").NavState;
|
|
212
|
+
navSite: import("./navSite").NavSiteState;
|
|
213
|
+
notifications: import("@open-tender/types").Notifications;
|
|
214
|
+
oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
|
|
215
|
+
order: import("./order").OrderState;
|
|
216
|
+
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
217
|
+
orderRating: import("./orderRating").OrderRatingState;
|
|
218
|
+
posts: import("./posts").PostsSlice;
|
|
219
|
+
pushNotifications: import("./pushNotifications").PushNotificationsState;
|
|
220
|
+
qr: import("./qr").QrState;
|
|
221
|
+
quote: import("./quote").QuoteState;
|
|
222
|
+
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
223
|
+
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
224
|
+
sidebar: import("./sidebar").SidebarState;
|
|
225
|
+
sidebarModal: import("./sidebarModal").SidebarModalState;
|
|
226
|
+
signUp: import("./signUp").SignUpState;
|
|
227
|
+
tags: import("./tags").TagsState;
|
|
228
|
+
terms: import("./terms").TermsSlice;
|
|
229
|
+
validTimes: import("./validTimes").ValidTimesState;
|
|
230
|
+
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
231
|
+
}) => {}) & import("reselect").OutputSelectorFields<(args_0: (import("@open-tender/types").BottomTabsDisplayed & import("@open-tender/types").BottomTabsTitles) | undefined) => {}, {
|
|
232
|
+
clearCache: () => void;
|
|
233
|
+
}> & {
|
|
234
|
+
clearCache: () => void;
|
|
235
|
+
};
|
|
169
236
|
export declare const selectSoldOutMsg: (state: AppState) => string;
|
|
170
237
|
export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number;
|
|
171
238
|
export declare const selectOutpostName: (state: AppState) => string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectPage = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectCateringOnly = exports.selectAccountConfig = exports.selectApi = exports.selectPages = exports.selectStylesheet = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
4
|
+
exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectBottomTabsTitles = exports.selectBottomTabsDisplayed = exports.selectPage = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectCateringOnly = exports.selectAccountConfig = exports.selectApi = exports.selectPages = exports.selectStylesheet = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const utils_1 = require("@open-tender/utils");
|
|
@@ -133,6 +133,20 @@ const selectContentSection = (page) => (state) => state.config.content ? state.c
|
|
|
133
133
|
exports.selectContentSection = selectContentSection;
|
|
134
134
|
const selectPage = (page) => (state) => state.config.pages ? state.config.pages[page] : undefined;
|
|
135
135
|
exports.selectPage = selectPage;
|
|
136
|
+
const selectBottomTabsDisplayed = (state) => { var _a; return ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.bottomTabs.displayed) || []; };
|
|
137
|
+
exports.selectBottomTabsDisplayed = selectBottomTabsDisplayed;
|
|
138
|
+
exports.selectBottomTabsTitles = (0, toolkit_1.createSelector)((state) => {
|
|
139
|
+
const { bottomTabs } = state.config.content || {};
|
|
140
|
+
return bottomTabs;
|
|
141
|
+
}, bottomTabs => {
|
|
142
|
+
if (!bottomTabs)
|
|
143
|
+
return {};
|
|
144
|
+
return Object.entries(bottomTabs).reduce((obj, [key, value]) => {
|
|
145
|
+
if (key === 'displayed')
|
|
146
|
+
return obj;
|
|
147
|
+
return Object.assign(Object.assign({}, obj), { [key]: value.title });
|
|
148
|
+
}, {});
|
|
149
|
+
});
|
|
136
150
|
const selectSoldOutMsg = (state) => {
|
|
137
151
|
var _a;
|
|
138
152
|
const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
|
|
@@ -18,6 +18,16 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
|
|
|
18
18
|
fulfilledMeta?: unknown;
|
|
19
19
|
rejectedMeta?: unknown;
|
|
20
20
|
}>;
|
|
21
|
+
export declare const verifyCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
22
|
+
state: AppState;
|
|
23
|
+
rejectValue: RequestError;
|
|
24
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
25
|
+
extra?: unknown;
|
|
26
|
+
serializedErrorType?: unknown;
|
|
27
|
+
pendingMeta?: unknown;
|
|
28
|
+
fulfilledMeta?: unknown;
|
|
29
|
+
rejectedMeta?: unknown;
|
|
30
|
+
}>;
|
|
21
31
|
export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
|
|
22
32
|
export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
|
|
23
33
|
export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.customerTplsReducer = exports.selectCustomerTplsProgress = exports.selectCustomerTplsRewards = exports.selectCustomerTplsPoints = exports.selectCustomerTpls = exports.resetCustomerTpls = exports.fetchCustomerTpls = exports.CustomerTplsActionType = void 0;
|
|
3
|
+
exports.customerTplsReducer = exports.selectCustomerTplsProgress = exports.selectCustomerTplsRewards = exports.selectCustomerTplsPoints = exports.selectCustomerTpls = exports.resetCustomerTpls = exports.verifyCustomerTpls = exports.fetchCustomerTpls = exports.CustomerTplsActionType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const types_1 = require("../types");
|
|
@@ -29,6 +29,15 @@ exports.fetchCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionTy
|
|
|
29
29
|
return (0, account_1.checkAuth)(error, dispatch, () => rejectWithValue(error));
|
|
30
30
|
}
|
|
31
31
|
}));
|
|
32
|
+
exports.verifyCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionType.FetchCustomerTpls, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
try {
|
|
34
|
+
const api = getState().config.api;
|
|
35
|
+
return yield api.postCustomerTplsVerify();
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
return rejectWithValue(err);
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
32
41
|
const customerTplsSlice = (0, toolkit_1.createSlice)({
|
|
33
42
|
name: types_1.ReducerType.Tpls,
|
|
34
43
|
initialState,
|
|
@@ -48,6 +57,17 @@ const customerTplsSlice = (0, toolkit_1.createSlice)({
|
|
|
48
57
|
.addCase(exports.fetchCustomerTpls.rejected, (state, action) => {
|
|
49
58
|
state.error = action.payload;
|
|
50
59
|
state.loading = 'idle';
|
|
60
|
+
})
|
|
61
|
+
.addCase(exports.verifyCustomerTpls.fulfilled, state => {
|
|
62
|
+
state.loading = 'idle';
|
|
63
|
+
state.error = null;
|
|
64
|
+
})
|
|
65
|
+
.addCase(exports.verifyCustomerTpls.pending, state => {
|
|
66
|
+
state.loading = 'pending';
|
|
67
|
+
})
|
|
68
|
+
.addCase(exports.verifyCustomerTpls.rejected, (state, action) => {
|
|
69
|
+
state.error = action.payload;
|
|
70
|
+
state.loading = 'idle';
|
|
51
71
|
});
|
|
52
72
|
}
|
|
53
73
|
});
|
|
@@ -160,6 +160,7 @@ declare class OpenTenderAPI {
|
|
|
160
160
|
getCustomerLoyaltyV2(token: string): Promise<unknown>;
|
|
161
161
|
getCustomerThanx(token: string): Promise<unknown>;
|
|
162
162
|
getThanxCardSignature(token: string, acct: string): Promise<unknown>;
|
|
163
|
+
postCustomerTplsVerify(): Promise<unknown>;
|
|
163
164
|
getCustomerTpls(token: string): Promise<unknown>;
|
|
164
165
|
getCustomerTplsHistory(token: string): Promise<unknown>;
|
|
165
166
|
getCustomerHouseAccounts(token: string): Promise<unknown>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -694,6 +694,9 @@ class OpenTenderAPI {
|
|
|
694
694
|
getThanxCardSignature(token, acct) {
|
|
695
695
|
return this.request(`/customer/thanx-card-signature?acct=${acct}`, 'GET', null, null, token);
|
|
696
696
|
}
|
|
697
|
+
postCustomerTplsVerify() {
|
|
698
|
+
return this.request(`/customer/tpls/email-verify`, 'POST', {});
|
|
699
|
+
}
|
|
697
700
|
getCustomerTpls(token) {
|
|
698
701
|
return this.request(`/customer/tpls`, 'GET', null, null, token);
|
|
699
702
|
}
|
|
@@ -166,6 +166,73 @@ export declare const selectFulfillment: (state: AppState) => import("@open-tende
|
|
|
166
166
|
export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined;
|
|
167
167
|
export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined;
|
|
168
168
|
export declare const selectPage: (page: ConfigPageType) => (state: AppState) => ConfigPage | undefined;
|
|
169
|
+
export declare const selectBottomTabsDisplayed: (state: AppState) => import("@open-tender/types").BottomTabsSections;
|
|
170
|
+
export declare const selectBottomTabsTitles: ((state: import("redux").EmptyObject & {
|
|
171
|
+
alerts: import("@open-tender/types").Alerts;
|
|
172
|
+
allergens: import("./allergens").AllergensState;
|
|
173
|
+
announcements: import("./announcements").AnnouncementsState;
|
|
174
|
+
checkout: import("./checkout").CheckoutState;
|
|
175
|
+
completedOrders: import("./completedOrders").CompletedOrdersState;
|
|
176
|
+
config: ConfigState;
|
|
177
|
+
confirmation: import("./confirmation").ConfirmationState;
|
|
178
|
+
customer: import("redux").CombinedState<{
|
|
179
|
+
account: import("./customer").AccountState;
|
|
180
|
+
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
181
|
+
creditCards: import("./customer").CustomerCreditCardsState;
|
|
182
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
183
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
184
|
+
favorites: import("./customer").CustomerFavoritesState;
|
|
185
|
+
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
186
|
+
giftCards: import("./customer").CustomerGiftCardsState;
|
|
187
|
+
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
188
|
+
history: import("./customer").CustomerHistoryState;
|
|
189
|
+
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
190
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
191
|
+
order: import("./customer").CustomerOrderState;
|
|
192
|
+
orders: import("./customer").CustomerOrdersState;
|
|
193
|
+
pointsShop: import("./customer").PointsShopState;
|
|
194
|
+
qrcode: import("./customer").CustomerQRCodeState;
|
|
195
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
196
|
+
thanx: import("./customer").CustomerThanxState;
|
|
197
|
+
tpls: import("./customer").CustomerTplsState;
|
|
198
|
+
}>;
|
|
199
|
+
deals: import("./deals").DealsState;
|
|
200
|
+
donations: import("./donations").DonationState;
|
|
201
|
+
geolocation: import("./geolocation").GeoLocationState;
|
|
202
|
+
giftCards: import("./giftCards").GiftCardsState;
|
|
203
|
+
groupOrder: import("./groupOrder").GroupOrderState;
|
|
204
|
+
guest: import("./guest").GuestState;
|
|
205
|
+
loader: import("./loader").LoaderState;
|
|
206
|
+
menu: import("./menu").MenuState;
|
|
207
|
+
menuDisplay: import("./menuDisplay").MenuDisplayState;
|
|
208
|
+
menuItems: import("./menuItems").MenuItemsState;
|
|
209
|
+
modal: import("@open-tender/types").Modal;
|
|
210
|
+
misc: import("./misc").MiscState;
|
|
211
|
+
nav: import("./nav").NavState;
|
|
212
|
+
navSite: import("./navSite").NavSiteState;
|
|
213
|
+
notifications: import("@open-tender/types").Notifications;
|
|
214
|
+
oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
|
|
215
|
+
order: import("./order").OrderState;
|
|
216
|
+
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
217
|
+
orderRating: import("./orderRating").OrderRatingState;
|
|
218
|
+
posts: import("./posts").PostsSlice;
|
|
219
|
+
pushNotifications: import("./pushNotifications").PushNotificationsState;
|
|
220
|
+
qr: import("./qr").QrState;
|
|
221
|
+
quote: import("./quote").QuoteState;
|
|
222
|
+
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
223
|
+
revenueCenters: import("./revenueCenters").RevenueCentersState;
|
|
224
|
+
sidebar: import("./sidebar").SidebarState;
|
|
225
|
+
sidebarModal: import("./sidebarModal").SidebarModalState;
|
|
226
|
+
signUp: import("./signUp").SignUpState;
|
|
227
|
+
tags: import("./tags").TagsState;
|
|
228
|
+
terms: import("./terms").TermsSlice;
|
|
229
|
+
validTimes: import("./validTimes").ValidTimesState;
|
|
230
|
+
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
231
|
+
}) => {}) & import("reselect").OutputSelectorFields<(args_0: (import("@open-tender/types").BottomTabsDisplayed & import("@open-tender/types").BottomTabsTitles) | undefined) => {}, {
|
|
232
|
+
clearCache: () => void;
|
|
233
|
+
}> & {
|
|
234
|
+
clearCache: () => void;
|
|
235
|
+
};
|
|
169
236
|
export declare const selectSoldOutMsg: (state: AppState) => string;
|
|
170
237
|
export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number;
|
|
171
238
|
export declare const selectOutpostName: (state: AppState) => string | undefined;
|
|
@@ -112,6 +112,19 @@ export const selectFulfillment = (state) => { var _a; return (_a = state.config.
|
|
|
112
112
|
export const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.recaptcha; };
|
|
113
113
|
export const selectContentSection = (page) => (state) => state.config.content ? state.config.content[page] : undefined;
|
|
114
114
|
export const selectPage = (page) => (state) => state.config.pages ? state.config.pages[page] : undefined;
|
|
115
|
+
export const selectBottomTabsDisplayed = (state) => { var _a; return ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.bottomTabs.displayed) || []; };
|
|
116
|
+
export const selectBottomTabsTitles = createSelector((state) => {
|
|
117
|
+
const { bottomTabs } = state.config.content || {};
|
|
118
|
+
return bottomTabs;
|
|
119
|
+
}, bottomTabs => {
|
|
120
|
+
if (!bottomTabs)
|
|
121
|
+
return {};
|
|
122
|
+
return Object.entries(bottomTabs).reduce((obj, [key, value]) => {
|
|
123
|
+
if (key === 'displayed')
|
|
124
|
+
return obj;
|
|
125
|
+
return Object.assign(Object.assign({}, obj), { [key]: value.title });
|
|
126
|
+
}, {});
|
|
127
|
+
});
|
|
115
128
|
export const selectSoldOutMsg = (state) => {
|
|
116
129
|
var _a;
|
|
117
130
|
const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
|
|
@@ -18,6 +18,16 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
|
|
|
18
18
|
fulfilledMeta?: unknown;
|
|
19
19
|
rejectedMeta?: unknown;
|
|
20
20
|
}>;
|
|
21
|
+
export declare const verifyCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
22
|
+
state: AppState;
|
|
23
|
+
rejectValue: RequestError;
|
|
24
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
25
|
+
extra?: unknown;
|
|
26
|
+
serializedErrorType?: unknown;
|
|
27
|
+
pendingMeta?: unknown;
|
|
28
|
+
fulfilledMeta?: unknown;
|
|
29
|
+
rejectedMeta?: unknown;
|
|
30
|
+
}>;
|
|
21
31
|
export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
|
|
22
32
|
export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
|
|
23
33
|
export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
|
|
@@ -26,6 +26,15 @@ export const fetchCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCu
|
|
|
26
26
|
return checkAuth(error, dispatch, () => rejectWithValue(error));
|
|
27
27
|
}
|
|
28
28
|
}));
|
|
29
|
+
export const verifyCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCustomerTpls, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
try {
|
|
31
|
+
const api = getState().config.api;
|
|
32
|
+
return yield api.postCustomerTplsVerify();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return rejectWithValue(err);
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
29
38
|
const customerTplsSlice = createSlice({
|
|
30
39
|
name: ReducerType.Tpls,
|
|
31
40
|
initialState,
|
|
@@ -45,6 +54,17 @@ const customerTplsSlice = createSlice({
|
|
|
45
54
|
.addCase(fetchCustomerTpls.rejected, (state, action) => {
|
|
46
55
|
state.error = action.payload;
|
|
47
56
|
state.loading = 'idle';
|
|
57
|
+
})
|
|
58
|
+
.addCase(verifyCustomerTpls.fulfilled, state => {
|
|
59
|
+
state.loading = 'idle';
|
|
60
|
+
state.error = null;
|
|
61
|
+
})
|
|
62
|
+
.addCase(verifyCustomerTpls.pending, state => {
|
|
63
|
+
state.loading = 'pending';
|
|
64
|
+
})
|
|
65
|
+
.addCase(verifyCustomerTpls.rejected, (state, action) => {
|
|
66
|
+
state.error = action.payload;
|
|
67
|
+
state.loading = 'idle';
|
|
48
68
|
});
|
|
49
69
|
}
|
|
50
70
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
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",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^18.2.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@open-tender/types": "^0.4.
|
|
58
|
+
"@open-tender/types": "^0.4.11",
|
|
59
59
|
"@open-tender/utils": "^0.4.6"
|
|
60
60
|
}
|
|
61
61
|
}
|