@zeniai/client-epic-state 4.12.9 → 4.12.10

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.
@@ -18,11 +18,14 @@ const saveTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
18
18
  ? zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, payload)
19
19
  : zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload);
20
20
  return saveTaskApi.pipe((0, operators_1.mergeMap)((response) => {
21
+ var _a;
21
22
  if ((0, responsePayload_1.isSuccessResponse)(response) &&
22
23
  response.data != null &&
23
- response.data.tasks.length > 0 &&
24
- taskGroupId != null) {
24
+ response.data.tasks.length > 0) {
25
25
  const newTaskId = response.data.tasks[0].task_id;
26
+ const newTaskGroupId = taskGroupId != null
27
+ ? taskGroupId
28
+ : (_a = response.data.tasks[0].task_group_ids) === null || _a === void 0 ? void 0 : _a[0];
26
29
  const fetchActions = [
27
30
  (0, taskReducer_1.updateTasks)(response.data.tasks),
28
31
  (0, taskDetailReducer_1.saveTaskSuccessOrFailure)({
@@ -30,11 +33,13 @@ const saveTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
30
33
  newTaskId,
31
34
  taskId,
32
35
  }),
33
- (0, taskListReducer_1.updateTaskListOnNewTaskCreationSuccess)({
34
- taskGroupId,
35
- task: response.data.tasks[0],
36
- }),
37
36
  ];
37
+ if (newTaskGroupId != null) {
38
+ fetchActions.push((0, taskListReducer_1.updateTaskListOnNewTaskCreationSuccess)({
39
+ taskGroupId: newTaskGroupId,
40
+ task: response.data.tasks[0],
41
+ }));
42
+ }
38
43
  return (0, rxjs_1.from)(fetchActions);
39
44
  }
40
45
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.9",
3
+ "version": "4.12.10",
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",