@zeniai/client-epic-state 4.19.71-beta0ND → 4.19.71
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.
- package/lib/esm/view/notificationView/epics/fetchNotificationUnreadCountEpic.js +3 -3
- package/lib/esm/view/notificationView/epics/fetchNotificationViewEpic.js +3 -3
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/notificationView/epics/fetchNotificationUnreadCountEpic.js +2 -2
- package/lib/view/notificationView/epics/fetchNotificationViewEpic.js +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter,
|
|
2
|
+
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
4
|
import { fetchNotificationUnreadCount, fetchNotificationUnreadCountFailure, fetchNotificationUnreadCountSuccess, } from '../notificationViewReducer';
|
|
5
|
-
export const fetchNotificationUnreadCountEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchNotificationUnreadCount.match),
|
|
5
|
+
export const fetchNotificationUnreadCountEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchNotificationUnreadCount.match), switchMap((action) => {
|
|
6
6
|
const { notificationGroup, mode } = action.payload;
|
|
7
7
|
const queryParam = {
|
|
8
8
|
fetch_unread_notification_count: true,
|
|
@@ -11,7 +11,7 @@ export const fetchNotificationUnreadCountEpic = (actions$, _state$, zeniAPI) =>
|
|
|
11
11
|
};
|
|
12
12
|
return zeniAPI
|
|
13
13
|
.getJSON(`${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/user-notification?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
14
|
-
.pipe(
|
|
14
|
+
.pipe(switchMap((response) => {
|
|
15
15
|
if (isSuccessResponse(response) && response.data != null) {
|
|
16
16
|
const { count: { unread }, } = response.data;
|
|
17
17
|
const actions = [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter,
|
|
2
|
+
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAllNotifications } from '../../../entity/notification/notificationReducer';
|
|
4
4
|
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
5
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
6
|
import { fetchNotificationView, fetchNotificationViewFailure, fetchNotificationViewSuccess, toNotificationTab, } from '../notificationViewReducer';
|
|
7
|
-
export const fetchNotificationViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchNotificationView.match),
|
|
7
|
+
export const fetchNotificationViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchNotificationView.match), switchMap((action) => {
|
|
8
8
|
const { notificationGroup, mode, status, isNewNotificationFetch } = action.payload;
|
|
9
9
|
const { stateByTab } = state$.value.notificationViewState;
|
|
10
10
|
const notificationTab = toNotificationTab(notificationGroup);
|
|
@@ -21,7 +21,7 @@ export const fetchNotificationViewEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
21
21
|
};
|
|
22
22
|
return zeniAPI
|
|
23
23
|
.getJSON(`${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/user-notification?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
24
|
-
.pipe(
|
|
24
|
+
.pipe(switchMap((response) => {
|
|
25
25
|
if (isSuccessResponse(response) && response.data != null) {
|
|
26
26
|
const { notifications, total_count, next_page_token } = response.data;
|
|
27
27
|
const allUsers = [];
|