@zeniai/client-epic-state 4.20.2-beta29RR → 4.20.2-beta30RR

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.
@@ -16,7 +16,8 @@ const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
16
16
  const state = state$.value;
17
17
  const { taskIds, updates, groupId } = action.payload;
18
18
  const payload = {
19
- tasks: (0, exports.getTasksListPayload)(state, taskIds, updates),
19
+ task_ids: taskIds,
20
+ updates: toBulkUpdatesPayload(state, updates, groupId),
20
21
  };
21
22
  return zeniAPI
22
23
  .putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
@@ -40,6 +41,46 @@ const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
40
41
  }));
41
42
  }));
42
43
  exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
44
+ const toBulkUpdatesPayload = (_state, updates, groupId) => {
45
+ const payload = {};
46
+ if (updates.status != null) {
47
+ payload.status = updates.status.code;
48
+ }
49
+ if (updates.priority != null) {
50
+ payload.priority = updates.priority.code;
51
+ }
52
+ if (updates.assignees != null) {
53
+ payload.assignees = updates.assignees;
54
+ }
55
+ if (updates.groupAssignees != null) {
56
+ payload.group_assignees = updates.groupAssignees;
57
+ }
58
+ if (updates.dueDate != null) {
59
+ payload.due_date = updates.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT);
60
+ }
61
+ if (updates.tagIds != null) {
62
+ payload.tags = updates.tagIds;
63
+ }
64
+ if (updates.timeSpent != null) {
65
+ payload.time_spent = (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(updates.timeSpent);
66
+ }
67
+ if (updates.isArchived != null) {
68
+ payload.is_archived = updates.isArchived;
69
+ }
70
+ if (updates.isDeleted != null) {
71
+ payload.is_deleted = updates.isDeleted;
72
+ }
73
+ if ('snoozedUntil' in updates) {
74
+ payload.snoozed_until = null;
75
+ payload.snoozed_by = null;
76
+ payload.snoozed_at = null;
77
+ payload.is_snooze_notification_sent = false;
78
+ }
79
+ if (groupId != null) {
80
+ payload.task_group_ids = [groupId];
81
+ }
82
+ return payload;
83
+ };
43
84
  const getTasksListPayload = (state, taskIds, updates) => {
44
85
  const { taskState } = state;
45
86
  const tasksList = taskIds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.20.2-beta29RR",
3
+ "version": "4.20.2-beta30RR",
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",