@open-tender/cloud 0.4.19 → 0.4.21
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.
|
@@ -20,10 +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 exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<{
|
|
24
|
-
data: Discount;
|
|
25
|
-
entities: Discounts;
|
|
26
|
-
}, string, {
|
|
23
|
+
export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<Discounts, string, {
|
|
27
24
|
state: AppState;
|
|
28
25
|
rejectValue: RequestError;
|
|
29
26
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -39,9 +39,8 @@ exports.exchangePointsShopReward = (0, toolkit_1.createAsyncThunk)(PointsShopAct
|
|
|
39
39
|
const token = (0, account_1.selectToken)(getState());
|
|
40
40
|
if (!token)
|
|
41
41
|
throw new Error(types_2.MISSING_CUSTOMER);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return { data, entities };
|
|
42
|
+
yield api.postPointsShopReward(token, rewardId);
|
|
43
|
+
return yield api.getPointsShop(token);
|
|
45
44
|
}
|
|
46
45
|
catch (err) {
|
|
47
46
|
return rejectWithValue(err);
|
|
@@ -68,8 +67,7 @@ const pointsShopSlice = (0, toolkit_1.createSlice)({
|
|
|
68
67
|
state.loading = 'idle';
|
|
69
68
|
})
|
|
70
69
|
.addCase(exports.exchangePointsShopReward.fulfilled, (state, action) => {
|
|
71
|
-
state.entities = action.payload
|
|
72
|
-
state.data = action.payload.data;
|
|
70
|
+
state.entities = action.payload;
|
|
73
71
|
state.loading = 'idle';
|
|
74
72
|
state.error = null;
|
|
75
73
|
})
|
|
@@ -20,10 +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 exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<{
|
|
24
|
-
data: Discount;
|
|
25
|
-
entities: Discounts;
|
|
26
|
-
}, string, {
|
|
23
|
+
export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<Discounts, string, {
|
|
27
24
|
state: AppState;
|
|
28
25
|
rejectValue: RequestError;
|
|
29
26
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -36,9 +36,8 @@ export const exchangePointsShopReward = createAsyncThunk(PointsShopActionType.Ex
|
|
|
36
36
|
const token = selectToken(getState());
|
|
37
37
|
if (!token)
|
|
38
38
|
throw new Error(MISSING_CUSTOMER);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return { data, entities };
|
|
39
|
+
yield api.postPointsShopReward(token, rewardId);
|
|
40
|
+
return yield api.getPointsShop(token);
|
|
42
41
|
}
|
|
43
42
|
catch (err) {
|
|
44
43
|
return rejectWithValue(err);
|
|
@@ -65,8 +64,7 @@ const pointsShopSlice = createSlice({
|
|
|
65
64
|
state.loading = 'idle';
|
|
66
65
|
})
|
|
67
66
|
.addCase(exchangePointsShopReward.fulfilled, (state, action) => {
|
|
68
|
-
state.entities = action.payload
|
|
69
|
-
state.data = action.payload.data;
|
|
67
|
+
state.entities = action.payload;
|
|
70
68
|
state.loading = 'idle';
|
|
71
69
|
state.error = null;
|
|
72
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.21",
|
|
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",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@open-tender/types": "^0.4.
|
|
60
|
-
"@open-tender/utils": "^0.4.
|
|
59
|
+
"@open-tender/types": "^0.4.47",
|
|
60
|
+
"@open-tender/utils": "^0.4.25"
|
|
61
61
|
}
|
|
62
62
|
}
|