@zeniai/client-epic-state 5.2.56-betaRD1 → 5.2.57-beta0ND
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/lib/entity/invoicing/dunningCase/dunningCaseTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/index.js +2 -1
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
- package/lib/esm/view/recommendation/recommendationReducer.js +19 -7
- package/lib/esm/view/recommendation/recommendationSelector.js +2 -0
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +9 -8
- package/lib/index.d.ts +2 -1
- package/lib/index.js +27 -24
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
- package/lib/view/recommendation/recommendationReducer.d.ts +5 -1
- package/lib/view/recommendation/recommendationReducer.js +20 -8
- package/lib/view/recommendation/recommendationSelector.d.ts +2 -0
- package/lib/view/recommendation/recommendationSelector.js +5 -1
- package/lib/view/recommendation/recommendationState.d.ts +2 -0
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +2 -2
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +7 -6
- package/package.json +1 -1
- package/lib/tsconfig.mocks.tsbuildinfo +0 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts
CHANGED
|
@@ -26,6 +26,6 @@ export declare const fetchInvoicingDunningCaseList: import("@reduxjs/toolkit").A
|
|
|
26
26
|
ids: ID[];
|
|
27
27
|
keepExistingListItems: boolean;
|
|
28
28
|
nextCursor: string | null;
|
|
29
|
-
}, "invoicingDunningCaseListView/updateInvoicingDunningCaseList">, updateInvoicingDunningCaseListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseListFailure">, fetchInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingDunningCaseListView/fetchInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingDunningCaseListView/updateInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseCountsFailure">, updateInvoicingDunningCaseFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingDunningCaseFilters, "invoicingDunningCaseListView/updateInvoicingDunningCaseFilters">, setInvoicingDunningCaseActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
29
|
+
}, "invoicingDunningCaseListView/updateInvoicingDunningCaseList">, updateInvoicingDunningCaseListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseListFailure">, fetchInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingDunningCaseListView/fetchInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingDunningCaseListView/updateInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseCountsFailure">, updateInvoicingDunningCaseFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingDunningCaseFilters, "invoicingDunningCaseListView/updateInvoicingDunningCaseFilters">, setInvoicingDunningCaseActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "paused" | "all", "invoicingDunningCaseListView/setInvoicingDunningCaseActiveTab">;
|
|
30
30
|
declare const _default: import("redux").Reducer<InvoicingDunningCaseListViewState>;
|
|
31
31
|
export default _default;
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export interface InvoicingDunningCaseColumnConfig {
|
|
|
19
19
|
sortable: boolean;
|
|
20
20
|
}
|
|
21
21
|
export declare const INVOICING_DUNNING_CASE_COLUMNS: InvoicingDunningCaseColumnConfig[];
|
|
22
|
-
export declare const ALL_INVOICING_DUNNING_CASE_TAB_IDS: readonly ["all", "
|
|
23
|
-
export declare const toInvoicingDunningCaseTabId: (v: string) => "
|
|
22
|
+
export declare const ALL_INVOICING_DUNNING_CASE_TAB_IDS: readonly ["all", "retrying", "scheduled", "manual_review", "paused", "resolved", "cancelled"];
|
|
23
|
+
export declare const toInvoicingDunningCaseTabId: (v: string) => "cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "paused" | "all";
|
|
24
24
|
export type InvoicingDunningCaseTabId = ReturnType<typeof toInvoicingDunningCaseTabId>;
|
|
25
25
|
export interface InvoicingDunningCaseListViewState extends FetchedState {
|
|
26
26
|
/** Selected status tab (CES-owned so it persists across page revisits). */
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js
CHANGED
|
@@ -26,12 +26,12 @@ exports.INVOICING_DUNNING_CASE_COLUMNS = [
|
|
|
26
26
|
];
|
|
27
27
|
exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = [
|
|
28
28
|
'all',
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
29
|
+
'retrying',
|
|
30
|
+
'scheduled',
|
|
31
|
+
'manual_review',
|
|
32
|
+
'paused',
|
|
33
|
+
'resolved',
|
|
34
|
+
'cancelled',
|
|
35
35
|
];
|
|
36
36
|
const toInvoicingDunningCaseTabId = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS);
|
|
37
37
|
exports.toInvoicingDunningCaseTabId = toInvoicingDunningCaseTabId;
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const fetchInvoicingSubscriptionList: import("@reduxjs/toolkit").
|
|
|
27
27
|
ids: ID[];
|
|
28
28
|
keepExistingListItems: boolean;
|
|
29
29
|
nextCursor: string | null;
|
|
30
|
-
}, "invoicingSubscriptionListView/updateInvoicingSubscriptionList">, updateInvoicingSubscriptionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionListFailure">, fetchInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSubscriptionListView/fetchInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingSubscriptionListView/updateInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionCountsFailure">, updateInvoicingSubscriptionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSubscriptionFilters, "invoicingSubscriptionListView/updateInvoicingSubscriptionFilters">, setInvoicingSubscriptionActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"active" | "cancelled" | "future" | "
|
|
30
|
+
}, "invoicingSubscriptionListView/updateInvoicingSubscriptionList">, updateInvoicingSubscriptionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionListFailure">, fetchInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSubscriptionListView/fetchInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingSubscriptionListView/updateInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionCountsFailure">, updateInvoicingSubscriptionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSubscriptionFilters, "invoicingSubscriptionListView/updateInvoicingSubscriptionFilters">, setInvoicingSubscriptionActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"active" | "cancelled" | "future" | "paused" | "in_trial" | "non_renewing" | "all", "invoicingSubscriptionListView/setInvoicingSubscriptionActiveTab">, addInvoicingSubscriptionToList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
31
|
id: ID;
|
|
32
32
|
status?: InvoicingSubscriptionStatus;
|
|
33
33
|
}, "invoicingSubscriptionListView/addInvoicingSubscriptionToList">;
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface InvoicingSubscriptionColumnConfig {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const INVOICING_SUBSCRIPTION_COLUMNS: InvoicingSubscriptionColumnConfig[];
|
|
25
25
|
export declare const ALL_INVOICING_SUBSCRIPTION_TAB_IDS: readonly ["all", "active", "in_trial", "future", "non_renewing", "paused", "cancelled"];
|
|
26
|
-
export declare const toInvoicingSubscriptionTabId: (v: string) => "active" | "cancelled" | "future" | "
|
|
26
|
+
export declare const toInvoicingSubscriptionTabId: (v: string) => "active" | "cancelled" | "future" | "paused" | "in_trial" | "non_renewing" | "all";
|
|
27
27
|
export type InvoicingSubscriptionTabId = ReturnType<typeof toInvoicingSubscriptionTabId>;
|
|
28
28
|
export interface InvoicingSubscriptionListViewState extends FetchedState {
|
|
29
29
|
/** Selected status tab (CES-owned so it persists across page revisits). */
|
|
@@ -58,6 +58,10 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
58
58
|
}, "recommendation/updateRecommendationForEntityFailure">, indicateReadyToInitializeRecommendation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityIdOrName: string, entityType: EntityType], {
|
|
59
59
|
entityIdOrName: string;
|
|
60
60
|
entityType: EntityType;
|
|
61
|
-
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>, submitRecommendationFeedback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: SubmitRecommendationFeedbackPayload], SubmitRecommendationFeedbackPayload, "recommendation/submitRecommendationFeedback", never, never
|
|
61
|
+
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>, submitRecommendationFeedback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: SubmitRecommendationFeedbackPayload], SubmitRecommendationFeedbackPayload, "recommendation/submitRecommendationFeedback", never, never>, submitRecommendationFeedbackCompleted: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: {
|
|
62
|
+
succeeded: boolean;
|
|
63
|
+
}], {
|
|
64
|
+
succeeded: boolean;
|
|
65
|
+
}, "recommendation/submitRecommendationFeedbackCompleted", never, never>;
|
|
62
66
|
declare const _default: import("redux").Reducer<EntityRecommendationState>;
|
|
63
67
|
export default _default;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.submitRecommendationFeedback = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
|
|
4
|
+
exports.submitRecommendationFeedbackCompleted = exports.submitRecommendationFeedback = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../rootActions");
|
|
7
7
|
const recommendationState_1 = require("./recommendationState");
|
|
8
8
|
exports.initialState = {
|
|
9
|
+
didLastFeedbackSubmitSucceed: null,
|
|
10
|
+
isSubmittingFeedback: false,
|
|
9
11
|
recommendationByEntity: {},
|
|
10
12
|
};
|
|
11
13
|
const recommendation = (0, toolkit_1.createSlice)({
|
|
@@ -135,13 +137,23 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
135
137
|
};
|
|
136
138
|
},
|
|
137
139
|
},
|
|
138
|
-
//
|
|
139
|
-
// override
|
|
140
|
-
//
|
|
141
|
-
//
|
|
140
|
+
// Human feedback on a recommendation (accept, ranked override or outside
|
|
141
|
+
// override). Handled by submitRecommendationFeedbackEpic, which POSTs to the
|
|
142
|
+
// accounting recommendation-feedback endpoint. The categorization itself
|
|
143
|
+
// never waits on this: only the feedback popup reads isSubmittingFeedback,
|
|
144
|
+
// so it can show a loader and report the real outcome.
|
|
142
145
|
submitRecommendationFeedback: {
|
|
143
|
-
reducer() {
|
|
144
|
-
|
|
146
|
+
reducer(draft) {
|
|
147
|
+
draft.isSubmittingFeedback = true;
|
|
148
|
+
},
|
|
149
|
+
prepare(args) {
|
|
150
|
+
return { payload: args };
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
submitRecommendationFeedbackCompleted: {
|
|
154
|
+
reducer(draft, action) {
|
|
155
|
+
draft.isSubmittingFeedback = false;
|
|
156
|
+
draft.didLastFeedbackSubmitSucceed = action.payload.succeeded;
|
|
145
157
|
},
|
|
146
158
|
prepare(args) {
|
|
147
159
|
return { payload: args };
|
|
@@ -154,7 +166,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
154
166
|
});
|
|
155
167
|
},
|
|
156
168
|
});
|
|
157
|
-
_a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.submitRecommendationFeedback = _a.submitRecommendationFeedback;
|
|
169
|
+
_a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.submitRecommendationFeedback = _a.submitRecommendationFeedback, exports.submitRecommendationFeedbackCompleted = _a.submitRecommendationFeedbackCompleted;
|
|
158
170
|
exports.default = recommendation.reducer;
|
|
159
171
|
const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
|
|
160
172
|
const key = (0, recommendationState_1.getEntityRecommendationKey)(entityType, entityId);
|
|
@@ -8,3 +8,5 @@ export interface RecommendationByEntitySelectorView extends SelectorView {
|
|
|
8
8
|
recommendations?: Recommendation[];
|
|
9
9
|
}
|
|
10
10
|
export declare const getRecommendationsForEntity: (state: RootState, entityId: string, entityType: EntityType) => RecommendationByEntitySelectorView;
|
|
11
|
+
export declare const getIsSubmittingRecommendationFeedback: (state: RootState) => boolean;
|
|
12
|
+
export declare const getDidLastRecommendationFeedbackSubmitSucceed: (state: RootState) => boolean | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRecommendationsForEntity = void 0;
|
|
3
|
+
exports.getDidLastRecommendationFeedbackSubmitSucceed = exports.getIsSubmittingRecommendationFeedback = exports.getRecommendationsForEntity = void 0;
|
|
4
4
|
const recommendationState_1 = require("./recommendationState");
|
|
5
5
|
const getRecommendationsForEntity = (state, entityId, entityType) => {
|
|
6
6
|
const { entityRecommendationState } = state;
|
|
@@ -15,3 +15,7 @@ const getRecommendationsForEntity = (state, entityId, entityType) => {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
exports.getRecommendationsForEntity = getRecommendationsForEntity;
|
|
18
|
+
const getIsSubmittingRecommendationFeedback = (state) => state.entityRecommendationState.isSubmittingFeedback;
|
|
19
|
+
exports.getIsSubmittingRecommendationFeedback = getIsSubmittingRecommendationFeedback;
|
|
20
|
+
const getDidLastRecommendationFeedbackSubmitSucceed = (state) => state.entityRecommendationState.didLastFeedbackSubmitSucceed;
|
|
21
|
+
exports.getDidLastRecommendationFeedbackSubmitSucceed = getDidLastRecommendationFeedbackSubmitSucceed;
|
|
@@ -8,5 +8,7 @@ export interface EntityRecommendationsStatus extends FetchedState {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const initialEntityRecommendationState: EntityRecommendationsStatus;
|
|
10
10
|
export interface EntityRecommendationState {
|
|
11
|
+
didLastFeedbackSubmitSucceed: boolean | null;
|
|
12
|
+
isSubmittingFeedback: boolean;
|
|
11
13
|
recommendationByEntity: Record<EntityRecommendationKey, EntityRecommendationsStatus>;
|
|
12
14
|
}
|
|
@@ -2,6 +2,6 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
-
import { submitRecommendationFeedback } from './recommendationReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof submitRecommendationFeedback>;
|
|
5
|
+
import { submitRecommendationFeedback, submitRecommendationFeedbackCompleted } from './recommendationReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof submitRecommendationFeedback> | ReturnType<typeof submitRecommendationFeedbackCompleted>;
|
|
7
7
|
export declare const submitRecommendationFeedbackEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -36,21 +36,22 @@ const toRequestBody = (payload) => ({
|
|
|
36
36
|
retracts_feedback_id: payload.retractsFeedbackId ?? null,
|
|
37
37
|
features: payload.features ?? null,
|
|
38
38
|
});
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
39
|
+
// Always reports completion so the feedback popup can show a loader and tell the
|
|
40
|
+
// user what happened. The categorization itself still never waits on this: a
|
|
41
|
+
// failure is surfaced in a toast rather than blocking or reverting the change.
|
|
42
42
|
const submitRecommendationFeedbackEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.submitRecommendationFeedback.match), (0, operators_1.mergeMap)((action) => {
|
|
43
43
|
const { transactionId } = action.payload;
|
|
44
44
|
return zeniAPI
|
|
45
45
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${transactionId}/recommendation-feedback`, toRequestBody(action.payload))
|
|
46
46
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
47
|
-
|
|
47
|
+
const succeeded = (0, responsePayload_1.isSuccessStatus)(response);
|
|
48
|
+
if (!succeeded) {
|
|
48
49
|
console.error('submitRecommendationFeedbackEpic: recommendation feedback was not recorded', response.status);
|
|
49
50
|
}
|
|
50
|
-
return rxjs_1.
|
|
51
|
+
return (0, rxjs_1.of)((0, recommendationReducer_1.submitRecommendationFeedbackCompleted)({ succeeded }));
|
|
51
52
|
}), (0, operators_1.catchError)((error) => {
|
|
52
53
|
console.error('submitRecommendationFeedbackEpic: failed to submit recommendation feedback', error);
|
|
53
|
-
return rxjs_1.
|
|
54
|
+
return (0, rxjs_1.of)((0, recommendationReducer_1.submitRecommendationFeedbackCompleted)({ succeeded: false }));
|
|
54
55
|
}));
|
|
55
56
|
}));
|
|
56
57
|
exports.submitRecommendationFeedbackEpic = submitRecommendationFeedbackEpic;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.57-beta0ND",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|