Merge pull request #2446 from bluewave-labs/fix/remove-team-and-user-id

fix: remove team and user
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-06-13 13:35:36 +08:00
commit df69d06048
17 files changed
+31 -46

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ const Incidents = () => {
//Utils
const theme = useTheme();
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId();
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({});
useEffect(() => {
const monitorLookup = monitors?.reduce((acc, monitor) => {
@@ -186,8 +186,6 @@ const CreateInfrastructureMonitor = () => {
...(isCreate ? {} : { _id: monitorId }),
...rest,
description: form.name,
teamId: user.teamId,
userId: user._id,
type: "hardware",
notifications: infrastructureMonitor.notifications,
thresholds,
@@ -48,8 +48,6 @@ const CreateNotifications = () => {
// local state
const [notification, setNotification] = useState({
userId: user._id,
teamId: user.teamId,
notificationName: "",
address: "",
type: NOTIFICATION_TYPES[0]._id,
@@ -86,8 +86,6 @@ const CreatePageSpeed = () => {
form = {
...form,
description: form.name,
teamId: user.teamId,
userId: user._id,
notifications: monitor.notifications,
};
+1 -1
View File
@@ -96,7 +96,7 @@ const Settings = () => {
}
if (name === "deleteStats") {
await deleteMonitorStats({ teamId: user.teamId });
await deleteMonitorStats();
return;
}
@@ -1,17 +1,14 @@
import { useState } from "react";
import { networkService } from "../../../../main";
import { useSelector } from "react-redux";
import { createToast } from "../../../../Utils/toastUtils";
const useCreateStatusPage = (isCreate, url) => {
const { user } = useSelector((state) => state.auth);
const [isLoading, setIsLoading] = useState(false);
const [networkError, setNetworkError] = useState(false);
const createStatusPage = async ({ form }) => {
setIsLoading(true);
try {
await networkService.createStatusPage({ user, form, isCreate, url });
await networkService.createStatusPage({ form, isCreate, url });
return true;
} catch (error) {
setNetworkError(true);
@@ -13,9 +13,7 @@ const useStatusPagesFetch = () => {
useEffect(() => {
const fetchStatusPages = async () => {
try {
const res = await networkService.getStatusPagesByTeamId({
teamId: user.teamId,
});
const res = await networkService.getStatusPagesByTeamId();
setStatusPages(res?.data?.data);
} catch (error) {
setNetworkError(true);
-6
View File
@@ -18,7 +18,6 @@ import Checkbox from "../../../Components/Inputs/Checkbox";
// Utils
import { useTheme } from "@emotion/react";
import { useState } from "react";
import { useSelector } from "react-redux";
import { useTranslation } from "react-i18next";
import { monitorValidation } from "../../../Validation/validation";
import { createToast } from "../../../Utils/toastUtils";
@@ -26,9 +25,6 @@ import { useGetNotificationsByTeamId } from "../../../Hooks/useNotifications";
import { useCreateMonitor } from "../../../Hooks/monitorHooks";
const CreateMonitor = () => {
// Redux state
const { user } = useSelector((state) => state.auth);
// Local state
const [errors, setErrors] = useState({});
const [https, setHttps] = useState(true);
@@ -143,8 +139,6 @@ const CreateMonitor = () => {
form = {
...form,
description: monitor.name || monitor.url,
teamId: user.teamId,
userId: user._id,
notifications: monitor.notifications,
};