@zeniai/client-epic-state 4.9.23 → 4.9.24
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.
|
@@ -42,10 +42,17 @@ const getRecommendationByLineIdFromRecommendationPayload = (recommendationPayloa
|
|
|
42
42
|
return undefined;
|
|
43
43
|
}
|
|
44
44
|
const recommendationsWithLine = {};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
/* Note: Below case will happen only when we are fetching vendor recomemndations from a JE transaction line item.
|
|
46
|
+
And in such a case, we only want to update recommendation for that line.lineIds will always have a single element */
|
|
47
|
+
if (lineIds.length !== recommendationPayload.length) {
|
|
48
|
+
recommendationsWithLine[lineIds[0]] = (0, transactionPayload_1.transformRecommendation)(recommendationPayload[parseInt(lineIds[0])]);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
recommendationPayload.forEach((lineRecommendations, index) => {
|
|
52
|
+
recommendationsWithLine[lineIds[index]] =
|
|
53
|
+
(0, transactionPayload_1.transformRecommendation)(lineRecommendations);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
49
56
|
return recommendationsWithLine;
|
|
50
57
|
};
|
|
51
58
|
exports.getRecommendationByLineIdFromRecommendationPayload = getRecommendationByLineIdFromRecommendationPayload;
|
|
@@ -269,6 +269,7 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
269
269
|
},
|
|
270
270
|
},
|
|
271
271
|
setEntityRecommendationForLineIdsForTransactionDetail: {
|
|
272
|
+
// ToDo: Add a reducer test case to handle this part for JE tran as well - where we only update for targeted line
|
|
272
273
|
reducer(draft, action) {
|
|
273
274
|
const { transaction, lineIds, recommendationByLineId, uncategorizedIncomeExpense, } = action.payload;
|
|
274
275
|
const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.24",
|
|
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",
|