@zeniai/client-epic-state 4.20.2-beta33RR → 4.20.2-beta34RR

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.
@@ -7,7 +7,7 @@ import { RootState } from '../../../../reducer';
7
7
  import { ZeniAPI } from '../../../../zeniAPI';
8
8
  import { bulkUpdateTaskList, updateTasksListOnBulkUpdateTasksFailure, updateTasksListOnBulkUpdateTasksSuccess } from '../taskListReducer';
9
9
  export type ActionType = ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTasksListOnBulkUpdateTasksFailure> | ReturnType<typeof updateTasksListOnBulkUpdateTasksSuccess>;
10
- export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
10
+ export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
11
11
  /**
12
12
  * Helpers
13
13
  */
@@ -12,20 +12,15 @@ const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpe
12
12
  const taskReducer_1 = require("../../../../entity/task/taskReducer");
13
13
  const responsePayload_1 = require("../../../../responsePayload");
14
14
  const taskListReducer_1 = require("../taskListReducer");
15
- const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
16
- const state = state$.value;
15
+ const bulkUpdateTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
17
16
  const { taskIds, updates, groupId } = action.payload;
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) };
17
+ const bulkUpdates = toBulkUpdatesPayload(updates);
18
+ if (groupId != null) {
19
+ bulkUpdates.task_group_ids = [groupId];
20
+ }
21
+ const payload = { task_ids: taskIds, updates: bulkUpdates };
27
22
  return zeniAPI
28
- .putAndGetJSON(url, payload)
23
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/bulk-update`, payload)
29
24
  .pipe((0, operators_1.mergeMap)((response) => {
30
25
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
31
26
  const removeFromList = updates.isArchived != null ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.20.2-beta33RR",
3
+ "version": "4.20.2-beta34RR",
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",