@zeniai/client-epic-state 4.20.2-beta31RR → 4.20.2-beta32RR
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.
|
@@ -15,12 +15,17 @@ const taskListReducer_1 = require("../taskListReducer");
|
|
|
15
15
|
const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
16
16
|
const state = state$.value;
|
|
17
17
|
const { taskIds, updates, groupId } = action.payload;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
// Move-to-group uses old endpoint with full task objects;
|
|
19
|
+
// all other bulk operations use the bulk-update endpoint
|
|
20
|
+
const isMoveToGroup = groupId != null;
|
|
21
|
+
const url = isMoveToGroup
|
|
22
|
+
? `${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`
|
|
23
|
+
: `${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/bulk-update`;
|
|
24
|
+
const payload = isMoveToGroup
|
|
25
|
+
? { tasks: (0, exports.getTasksListPayload)(state, taskIds, updates) }
|
|
26
|
+
: { task_ids: taskIds, updates: toBulkUpdatesPayload(updates) };
|
|
22
27
|
return zeniAPI
|
|
23
|
-
.putAndGetJSON(
|
|
28
|
+
.putAndGetJSON(url, payload)
|
|
24
29
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
30
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
26
31
|
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
@@ -41,7 +46,7 @@ const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
41
46
|
}));
|
|
42
47
|
}));
|
|
43
48
|
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
44
|
-
const toBulkUpdatesPayload = (
|
|
49
|
+
const toBulkUpdatesPayload = (updates) => {
|
|
45
50
|
const payload = {};
|
|
46
51
|
if (updates.status != null) {
|
|
47
52
|
payload.status = updates.status.code;
|
|
@@ -76,9 +81,6 @@ const toBulkUpdatesPayload = (_state, updates, groupId) => {
|
|
|
76
81
|
payload.snoozed_at = null;
|
|
77
82
|
payload.is_snooze_notification_sent = false;
|
|
78
83
|
}
|
|
79
|
-
if (groupId != null) {
|
|
80
|
-
payload.task_group_ids = [groupId];
|
|
81
|
-
}
|
|
82
84
|
return payload;
|
|
83
85
|
};
|
|
84
86
|
const getTasksListPayload = (state, taskIds, updates) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.20.2-
|
|
3
|
+
"version": "4.20.2-beta32RR",
|
|
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",
|