@zeniai/client-epic-state 4.17.60 → 4.17.61
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/commonPayloadTypes/dynamicPayloadKeys.d.ts +1 -0
- package/lib/commonPayloadTypes/dynamicPayloadKeys.js +4 -0
- package/lib/commonStateTypes/dynamicStateKeys.d.ts +1 -0
- package/lib/commonStateTypes/dynamicStateKeys.js +4 -0
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +13 -10
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ZENI_ENTITY_PAYLOAD_KEY = "qbo_id";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ZENI_ENTITY_STATE_KEY = "qboId";
|
|
@@ -55,27 +55,30 @@ const fetchTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
55
55
|
((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.transaction) === null || _b === void 0 ? void 0 : _b.transaction_id) != null) {
|
|
56
56
|
const updateActions = [];
|
|
57
57
|
const transcationId = (0, transactionIDPayload_1.toTransactionID)(response.data.transaction);
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const responseData = Object.assign(Object.assign({}, response.data), { vendors: (_d = (_c = response.data.vendors) === null || _c === void 0 ? void 0 : _c.map((vendor) => {
|
|
59
|
+
var _a;
|
|
60
|
+
return (Object.assign(Object.assign({}, vendor), { vendor_id: (_a = vendor.qbo_id) !== null && _a !== void 0 ? _a : vendor.vendor_id }));
|
|
61
|
+
})) !== null && _d !== void 0 ? _d : [] });
|
|
62
|
+
if (responseData.vendors.length > 0) {
|
|
63
|
+
updateActions.push((0, vendorReducer_1.updateVendors)(responseData.vendors, 'merge'));
|
|
60
64
|
}
|
|
61
65
|
const transactionDetailKeyForResponse = (0, transactionDetailState_1.getTransactionDetailKey)(transcationId);
|
|
62
|
-
updateActions.push((0, transactionReducer_1.updateTransaction)(transactionDetailKeyForResponse,
|
|
66
|
+
updateActions.push((0, transactionReducer_1.updateTransaction)(transactionDetailKeyForResponse, responseData.transaction));
|
|
63
67
|
updateActions.push((0, transactionDetailReducer_1.initializeTransactionDetailLocalData)({
|
|
64
68
|
transactionId: transcationId,
|
|
65
|
-
vendorId: (
|
|
69
|
+
vendorId: (_e = responseData.vendors[0]) === null || _e === void 0 ? void 0 : _e.vendor_id,
|
|
66
70
|
}));
|
|
67
71
|
updateActions.push((0, transactionDetailReducer_1.updateTransactionDetailFetchState)(transcationId, 'Completed'));
|
|
68
72
|
// IMPORTANT: Fetch linked transactions..
|
|
69
|
-
updateActions.push(...getAllFetchLinkedTransactionDetailActions(
|
|
70
|
-
if (
|
|
71
|
-
response.data.vendors.length > 0) {
|
|
73
|
+
updateActions.push(...getAllFetchLinkedTransactionDetailActions(responseData.transaction, state$.value));
|
|
74
|
+
if (responseData.vendors.length > 0) {
|
|
72
75
|
updateActions.push((0, transactionVendorViewReducer_1.updateTransactionVendorLocalData)({
|
|
73
|
-
vendorId:
|
|
74
|
-
localData: (0, transactionVendorLocalDataHelper_1.getInitializedTransactionVendorLocalData)((0, vendorPayload_1.mapVendorPayloadToVendor)(
|
|
76
|
+
vendorId: responseData.vendors[0].vendor_id,
|
|
77
|
+
localData: (0, transactionVendorLocalDataHelper_1.getInitializedTransactionVendorLocalData)((0, vendorPayload_1.mapVendorPayloadToVendor)(responseData.vendors[0])),
|
|
75
78
|
}));
|
|
76
79
|
}
|
|
77
80
|
// If vendor transaction, fetch owners list
|
|
78
|
-
if ((0, transactionType_1.toVendorTransactionTypeStrict)(
|
|
81
|
+
if ((0, transactionType_1.toVendorTransactionTypeStrict)(responseData.transaction.transaction_type) != null) {
|
|
79
82
|
updateActions.push((0, ownerListReducer_1.fetchOwnerList)());
|
|
80
83
|
}
|
|
81
84
|
return (0, rxjs_1.from)(updateActions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.61",
|
|
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
|
"types": "lib/index.d.ts",
|