diff --git a/src/components/NotificationsSidebar/index.js b/src/components/NotificationsSidebar/index.js index 52dc69a..a41e302 100644 --- a/src/components/NotificationsSidebar/index.js +++ b/src/components/NotificationsSidebar/index.js @@ -88,35 +88,24 @@ const NotificationsSidebar = () => { const bodyParams = getPaginationQuery(status, currentPage); if (currentSubscription) { - //console.log('UNsubscribed') currentSubscription.unsubscribe(); setCurrentSubscription(null); } if (userData.id && chosenCompanyId !== 0 && role === 'ROLE_BENEFICIARY') { setLoading(true); - NotificationService.getNotificationsByCompanyId( + NotificationService.getNotificationsByCompanyIdPagination( userData.id, chosenCompanyId, - status === 'UNREAD' ? getNotifications : getNotificationsRead, - errGetNotifications, - [ - ['status', status] - ] + bodyParams, + status === 'UNREAD' ? getNotificationsPagi : getNotificationsReadPagi, + errGetNotifications ); if (isConnected && socket.current) { subscribeTo(`/topic/notifications_user_${userData.id}_company_${chosenCompanyId}`) } } else if (userData.id && role !== 'ROLE_BENEFICIARY') { setLoading(true); - /*NotificationService.getNotifications( - userData.id, - status === 'UNREAD' ? getNotifications : getNotificationsRead, - errGetNotifications, - [ - ['status', status] - ] - );*/ NotificationService.getNotificationsPagination( userData.id, bodyParams, @@ -157,24 +146,6 @@ const NotificationsSidebar = () => { setLoading(false); } - const getNotifications = (resp) => { - if (resp.status === 'SUCCESS') { - setNotifications(resp.data); - setTotalRecordsNum(resp.data.length); - } - set404FromErrorResponse(resp); - setLoading(false); - } - - const getNotificationsRead = (resp) => { - if (resp.status === 'SUCCESS') { - setNotificationsRead(resp.data); - setTotalRecordsNum(resp.data.length); - } - set404FromErrorResponse(resp); - setLoading(false); - } - const errGetNotifications = (resp) => { set404FromErrorResponse(resp); setLoading(false); diff --git a/src/pages/DashboardInstructorManager/components/LatestBandiTableInstructorManager/index.js b/src/pages/DashboardInstructorManager/components/LatestBandiTableInstructorManager/index.js index 73334f9..a4b2da1 100644 --- a/src/pages/DashboardInstructorManager/components/LatestBandiTableInstructorManager/index.js +++ b/src/pages/DashboardInstructorManager/components/LatestBandiTableInstructorManager/index.js @@ -5,6 +5,10 @@ import { uniq } from 'ramda'; // api import BandoService from '../../../../service/bando-service'; +// tools +import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString'; +import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring'; + // components import { FilterMatchMode, FilterOperator } from 'primereact/api'; import { DataTable } from 'primereact/datatable'; @@ -12,10 +16,7 @@ import { Column } from 'primereact/column'; import { Button } from 'primereact/button'; import { Calendar } from 'primereact/calendar'; import ProperBandoLabel from '../../../../components/ProperBandoLabel'; -import { Link } from 'react-router-dom'; import translationStrings from '../../../../translationStringsForComponents'; -import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString'; -import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring'; const LatestBandiTable = () => { @@ -100,12 +101,6 @@ const LatestBandiTable = () => { return ; }; - const actionsBodyTemplate = (rowData) => { - return -