aboutsummaryrefslogtreecommitdiff
path: root/modern/src/CachingController.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-04-27 11:18:42 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-04-27 11:18:42 +0530
commit127a2628b61b0a151eb5225af7ecaf483f907665 (patch)
treecc596678a30c0c50d1a99831e30839cd964ed501 /modern/src/CachingController.js
parent2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b (diff)
downloadetbsa-traccar-web-127a2628b61b0a151eb5225af7ecaf483f907665.tar.gz
etbsa-traccar-web-127a2628b61b0a151eb5225af7ecaf483f907665.tar.bz2
etbsa-traccar-web-127a2628b61b0a151eb5225af7ecaf483f907665.zip
Deleting somne of the stores
Diffstat (limited to 'modern/src/CachingController.js')
-rw-r--r--modern/src/CachingController.js38
1 files changed, 1 insertions, 37 deletions
diff --git a/modern/src/CachingController.js b/modern/src/CachingController.js
index faeec48..3f808de 100644
--- a/modern/src/CachingController.js
+++ b/modern/src/CachingController.js
@@ -1,6 +1,6 @@
import { useDispatch, useSelector } from 'react-redux';
import { connect } from 'react-redux';
-import { geofencesActions, groupsActions, driversActions, calendarsActions, commandsActions, computedAttributesActions, maintenancesActions, notificationsActions } from './store';
+import { geofencesActions, groupsActions, driversActions, maintenancesActions } from './store';
import { useEffectAsync } from './reactHelper';
const CachingController = () => {
@@ -36,47 +36,11 @@ const CachingController = () => {
useEffectAsync(async () => {
if (authenticated) {
- const response = await fetch('/api/calendars');
- if (response.ok) {
- dispatch(calendarsActions.update(await response.json()));
- }
- }
- }, [authenticated]);
-
- useEffectAsync(async () => {
- if (authenticated) {
- const response = await fetch('/api/commands');
- if (response.ok) {
- dispatch(commandsActions.update(await response.json()));
- }
- }
- }, [authenticated]);
-
- useEffectAsync(async () => {
- if (authenticated) {
- const response = await fetch('/api/attributes/computed');
- if (response.ok) {
- dispatch(computedAttributesActions.update(await response.json()));
- }
- }
- }, [authenticated]);
-
- useEffectAsync(async () => {
- if (authenticated) {
const response = await fetch('/api/maintenance');
if (response.ok) {
dispatch(maintenancesActions.update(await response.json()));
}
}
- }, [authenticated]);
-
- useEffectAsync(async () => {
- if (authenticated) {
- const response = await fetch('/api/notifications');
- if (response.ok) {
- dispatch(notificationsActions.update(await response.json()));
- }
- }
}, [authenticated]);
return null;