Skip to content

Commit df69d06

Browse files
authored
Merge pull request #2446 from bluewave-labs/fix/remove-team-and-user-id
fix: remove team and user
2 parents ef8f74d + ab3f867 commit df69d06

File tree

17 files changed

+31
-46
lines changed

17 files changed

+31
-46
lines changed

client/src/Hooks/monitorHooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,10 @@ const useDeleteAllMonitors = () => {
414414
const UseDeleteMonitorStats = () => {
415415
const { t } = useTranslation();
416416
const [isLoading, setIsLoading] = useState(false);
417-
const deleteMonitorStats = async ({ teamId }) => {
417+
const deleteMonitorStats = async () => {
418418
setIsLoading(true);
419419
try {
420-
const res = await networkService.deleteChecksByTeamId({ teamId });
420+
await networkService.deleteChecksByTeamId();
421421
createToast({ body: t("settingsStatsCleared") });
422422
} catch (error) {
423423
createToast({ body: t("settingsFailedToClearStats") });

client/src/Hooks/useNotifications.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useState, useEffect, useCallback } from "react";
22
import { createToast } from "../Utils/toastUtils";
33
import { networkService } from "../main";
44
import { useNavigate } from "react-router-dom";
5-
import { useSelector } from "react-redux";
65
import { useTranslation } from "react-i18next";
76
import { NOTIFICATION_TYPES } from "../Pages/Notifications/utils";
87

client/src/Pages/Incidents/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const Incidents = () => {
2929

3030
//Utils
3131
const theme = useTheme();
32-
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId();
32+
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({});
3333

3434
useEffect(() => {
3535
const monitorLookup = monitors?.reduce((acc, monitor) => {

client/src/Pages/Infrastructure/Create/index.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ const CreateInfrastructureMonitor = () => {
186186
...(isCreate ? {} : { _id: monitorId }),
187187
...rest,
188188
description: form.name,
189-
teamId: user.teamId,
190-
userId: user._id,
191189
type: "hardware",
192190
notifications: infrastructureMonitor.notifications,
193191
thresholds,

client/src/Pages/Notifications/create/index.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ const CreateNotifications = () => {
4848

4949
// local state
5050
const [notification, setNotification] = useState({
51-
userId: user._id,
52-
teamId: user.teamId,
5351
notificationName: "",
5452
address: "",
5553
type: NOTIFICATION_TYPES[0]._id,

client/src/Pages/PageSpeed/Create/index.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ const CreatePageSpeed = () => {
8686
form = {
8787
...form,
8888
description: form.name,
89-
teamId: user.teamId,
90-
userId: user._id,
9189
notifications: monitor.notifications,
9290
};
9391

client/src/Pages/Settings/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const Settings = () => {
9696
}
9797

9898
if (name === "deleteStats") {
99-
await deleteMonitorStats({ teamId: user.teamId });
99+
await deleteMonitorStats();
100100
return;
101101
}
102102

client/src/Pages/StatusPage/Create/Hooks/useCreateStatusPage.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import { useState } from "react";
22
import { networkService } from "../../../../main";
3-
import { useSelector } from "react-redux";
43
import { createToast } from "../../../../Utils/toastUtils";
54

65
const useCreateStatusPage = (isCreate, url) => {
7-
const { user } = useSelector((state) => state.auth);
8-
96
const [isLoading, setIsLoading] = useState(false);
107
const [networkError, setNetworkError] = useState(false);
118
const createStatusPage = async ({ form }) => {
129
setIsLoading(true);
1310
try {
14-
await networkService.createStatusPage({ user, form, isCreate, url });
11+
await networkService.createStatusPage({ form, isCreate, url });
1512
return true;
1613
} catch (error) {
1714
setNetworkError(true);

client/src/Pages/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const useStatusPagesFetch = () => {
1313
useEffect(() => {
1414
const fetchStatusPages = async () => {
1515
try {
16-
const res = await networkService.getStatusPagesByTeamId({
17-
teamId: user.teamId,
18-
});
16+
const res = await networkService.getStatusPagesByTeamId();
1917
setStatusPages(res?.data?.data);
2018
} catch (error) {
2119
setNetworkError(true);

client/src/Pages/Uptime/Create/index.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@ import Checkbox from "../../../Components/Inputs/Checkbox";
1818
// Utils
1919
import { useTheme } from "@emotion/react";
2020
import { useState } from "react";
21-
import { useSelector } from "react-redux";
2221
import { useTranslation } from "react-i18next";
2322
import { monitorValidation } from "../../../Validation/validation";
2423
import { createToast } from "../../../Utils/toastUtils";
2524
import { useGetNotificationsByTeamId } from "../../../Hooks/useNotifications";
2625
import { useCreateMonitor } from "../../../Hooks/monitorHooks";
2726

2827
const CreateMonitor = () => {
29-
// Redux state
30-
const { user } = useSelector((state) => state.auth);
31-
3228
// Local state
3329
const [errors, setErrors] = useState({});
3430
const [https, setHttps] = useState(true);
@@ -143,8 +139,6 @@ const CreateMonitor = () => {
143139
form = {
144140
...form,
145141
description: monitor.name || monitor.url,
146-
teamId: user.teamId,
147-
userId: user._id,
148142
notifications: monitor.notifications,
149143
};
150144

0 commit comments

Comments
 (0)