@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.
@@ -10,7 +10,8 @@ export const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pi
10
10
  const state = state$.value;
11
11
  const { taskIds, updates, groupId } = action.payload;
12
12
  const payload = {
13
- tasks: getTasksListPayload(state, taskIds, updates),
13
+ task_ids: taskIds,
14
+ updates: toBulkUpdatesPayload(state, updates, groupId),
14
15
  };
15
16
  return zeniAPI
16
17
  .putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
@@ -33,6 +34,46 @@ export const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pi
33
34
  }));
34
35
  }));
35
36
  }));
37
+ const toBulkUpdatesPayload = (_state, updates, groupId) => {
38
+ const payload = {};
39
+ if (updates.status != null) {
40
+ payload.status = updates.status.code;
41
+ }
42
+ if (updates.priority != null) {
43
+ payload.priority = updates.priority.code;
44
+ }
45
+ if (updates.assignees != null) {
46
+ payload.assignees = updates.assignees;
47
+ }
48
+ if (updates.groupAssignees != null) {
49
+ payload.group_assignees = updates.groupAssignees;
50
+ }
51
+ if (updates.dueDate != null) {
52
+ payload.due_date = updates.dueDate.format(DEFAULT_DATE_FORMAT);
53
+ }
54
+ if (updates.tagIds != null) {
55
+ payload.tags = updates.tagIds;
56
+ }
57
+ if (updates.timeSpent != null) {
58
+ payload.time_spent = convertHHMMStrToMinutes(updates.timeSpent);
59
+ }
60
+ if (updates.isArchived != null) {
61
+ payload.is_archived = updates.isArchived;
62
+ }
63
+ if (updates.isDeleted != null) {
64
+ payload.is_deleted = updates.isDeleted;
65
+ }
66
+ if ('snoozedUntil' in updates) {
67
+ payload.snoozed_until = null;
68
+ payload.snoozed_by = null;
69
+ payload.snoozed_at = null;
70
+ payload.is_snooze_notification_sent = false;
71
+ }
72
+ if (groupId != null) {
73
+ payload.task_group_ids = [groupId];
74
+ }
75
+ return payload;
76
+ };
36
77
  export const getTasksListPayload = (state, taskIds, updates) => {
37
78
  const { taskState } = state;
38
79
  const tasksList = taskIds