@open-tender/cloud 0.4.16 → 0.4.18
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.
|
@@ -7,8 +7,8 @@ export interface PointsShopState {
|
|
|
7
7
|
loading: RequestStatus;
|
|
8
8
|
}
|
|
9
9
|
export declare enum PointsShopActionType {
|
|
10
|
-
FetchPointsShop = "
|
|
11
|
-
ExchangePointsShopReward = "
|
|
10
|
+
FetchPointsShop = "pointsShop/fetchPointsShop",
|
|
11
|
+
ExchangePointsShopReward = "pointsShop/exchangePointsShopReward"
|
|
12
12
|
}
|
|
13
13
|
export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<Discounts, void, {
|
|
14
14
|
state: AppState;
|
|
@@ -20,7 +20,7 @@ export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<Disc
|
|
|
20
20
|
fulfilledMeta?: unknown;
|
|
21
21
|
rejectedMeta?: unknown;
|
|
22
22
|
}>;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<{
|
|
24
24
|
data: Discount;
|
|
25
25
|
entities: Discounts;
|
|
26
26
|
}, string, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pointsShopReducer = exports.selectPointsShop = exports.resetPointsShop = exports.
|
|
3
|
+
exports.pointsShopReducer = exports.selectPointsShop = exports.resetPointsShop = exports.exchangePointsShopReward = exports.fetchPointsShop = exports.PointsShopActionType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const types_1 = require("../types");
|
|
@@ -14,8 +14,8 @@ const initialState = {
|
|
|
14
14
|
};
|
|
15
15
|
var PointsShopActionType;
|
|
16
16
|
(function (PointsShopActionType) {
|
|
17
|
-
PointsShopActionType["FetchPointsShop"] = "
|
|
18
|
-
PointsShopActionType["ExchangePointsShopReward"] = "
|
|
17
|
+
PointsShopActionType["FetchPointsShop"] = "pointsShop/fetchPointsShop";
|
|
18
|
+
PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
|
|
19
19
|
})(PointsShopActionType = exports.PointsShopActionType || (exports.PointsShopActionType = {}));
|
|
20
20
|
exports.fetchPointsShop = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
21
21
|
try {
|
|
@@ -31,7 +31,7 @@ exports.fetchPointsShop = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.F
|
|
|
31
31
|
return rejectWithValue(err);
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
|
-
exports.
|
|
34
|
+
exports.exchangePointsShopReward = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
35
35
|
try {
|
|
36
36
|
const { api } = getState().config;
|
|
37
37
|
if (!api)
|
|
@@ -67,16 +67,16 @@ const pointsShopSlice = (0, toolkit_1.createSlice)({
|
|
|
67
67
|
state.error = action.payload;
|
|
68
68
|
state.loading = 'idle';
|
|
69
69
|
})
|
|
70
|
-
.addCase(exports.
|
|
70
|
+
.addCase(exports.exchangePointsShopReward.fulfilled, (state, action) => {
|
|
71
71
|
state.entities = action.payload.entities;
|
|
72
72
|
state.data = action.payload.data;
|
|
73
73
|
state.loading = 'idle';
|
|
74
74
|
state.error = null;
|
|
75
75
|
})
|
|
76
|
-
.addCase(exports.
|
|
76
|
+
.addCase(exports.exchangePointsShopReward.pending, state => {
|
|
77
77
|
state.loading = 'pending';
|
|
78
78
|
})
|
|
79
|
-
.addCase(exports.
|
|
79
|
+
.addCase(exports.exchangePointsShopReward.rejected, (state, action) => {
|
|
80
80
|
state.error = action.payload;
|
|
81
81
|
state.loading = 'idle';
|
|
82
82
|
});
|
|
@@ -7,8 +7,8 @@ export interface PointsShopState {
|
|
|
7
7
|
loading: RequestStatus;
|
|
8
8
|
}
|
|
9
9
|
export declare enum PointsShopActionType {
|
|
10
|
-
FetchPointsShop = "
|
|
11
|
-
ExchangePointsShopReward = "
|
|
10
|
+
FetchPointsShop = "pointsShop/fetchPointsShop",
|
|
11
|
+
ExchangePointsShopReward = "pointsShop/exchangePointsShopReward"
|
|
12
12
|
}
|
|
13
13
|
export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<Discounts, void, {
|
|
14
14
|
state: AppState;
|
|
@@ -20,7 +20,7 @@ export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<Disc
|
|
|
20
20
|
fulfilledMeta?: unknown;
|
|
21
21
|
rejectedMeta?: unknown;
|
|
22
22
|
}>;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<{
|
|
24
24
|
data: Discount;
|
|
25
25
|
entities: Discounts;
|
|
26
26
|
}, string, {
|
|
@@ -11,8 +11,8 @@ const initialState = {
|
|
|
11
11
|
};
|
|
12
12
|
export var PointsShopActionType;
|
|
13
13
|
(function (PointsShopActionType) {
|
|
14
|
-
PointsShopActionType["FetchPointsShop"] = "
|
|
15
|
-
PointsShopActionType["ExchangePointsShopReward"] = "
|
|
14
|
+
PointsShopActionType["FetchPointsShop"] = "pointsShop/fetchPointsShop";
|
|
15
|
+
PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
|
|
16
16
|
})(PointsShopActionType || (PointsShopActionType = {}));
|
|
17
17
|
export const fetchPointsShop = createAsyncThunk(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
18
|
try {
|
|
@@ -28,7 +28,7 @@ export const fetchPointsShop = createAsyncThunk(PointsShopActionType.FetchPoints
|
|
|
28
28
|
return rejectWithValue(err);
|
|
29
29
|
}
|
|
30
30
|
}));
|
|
31
|
-
export const
|
|
31
|
+
export const exchangePointsShopReward = createAsyncThunk(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
32
|
try {
|
|
33
33
|
const { api } = getState().config;
|
|
34
34
|
if (!api)
|
|
@@ -64,16 +64,16 @@ const pointsShopSlice = createSlice({
|
|
|
64
64
|
state.error = action.payload;
|
|
65
65
|
state.loading = 'idle';
|
|
66
66
|
})
|
|
67
|
-
.addCase(
|
|
67
|
+
.addCase(exchangePointsShopReward.fulfilled, (state, action) => {
|
|
68
68
|
state.entities = action.payload.entities;
|
|
69
69
|
state.data = action.payload.data;
|
|
70
70
|
state.loading = 'idle';
|
|
71
71
|
state.error = null;
|
|
72
72
|
})
|
|
73
|
-
.addCase(
|
|
73
|
+
.addCase(exchangePointsShopReward.pending, state => {
|
|
74
74
|
state.loading = 'pending';
|
|
75
75
|
})
|
|
76
|
-
.addCase(
|
|
76
|
+
.addCase(exchangePointsShopReward.rejected, (state, action) => {
|
|
77
77
|
state.error = action.payload;
|
|
78
78
|
state.loading = 'idle';
|
|
79
79
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.18",
|
|
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",
|