Merge pull request #2445 from bluewave-labs/fix/checks-team-id
fix: checks team
This commit is contained in:
7 files changed
+58
-36
No files matched your search
@@ -24,7 +24,6 @@ const IncidentTable = ({
|
||||
}) => {
|
||||
//Redux state
|
||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
|
||||
//Local state
|
||||
const [teamId, setTeamId] = useState(undefined);
|
||||
@@ -61,13 +60,13 @@ const IncidentTable = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedMonitor === "0") {
|
||||
setTeamId(user.teamId);
|
||||
setTeamId("placeholder"); // TODO this isn't needed any longer, fix hook
|
||||
setMonitorId(undefined);
|
||||
} else {
|
||||
setMonitorId(selectedMonitor);
|
||||
setTeamId(undefined);
|
||||
}
|
||||
}, [selectedMonitor, user.teamId]);
|
||||
}, [selectedMonitor]);
|
||||
|
||||
const headers = [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ import OptionsHeader from "./Components/OptionsHeader";
|
||||
//Utils
|
||||
import { useTheme } from "@emotion/react";
|
||||
import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useState, useEffect } from "react";
|
||||
import NetworkError from "../../Components/GenericFallback/NetworkError";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -16,7 +15,6 @@ import { useTranslation } from "react-i18next";
|
||||
//Constants
|
||||
const Incidents = () => {
|
||||
// Redux state
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const BREADCRUMBS = [
|
||||
@@ -31,9 +29,7 @@ const Incidents = () => {
|
||||
|
||||
//Utils
|
||||
const theme = useTheme();
|
||||
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({
|
||||
teamId: user.teamId,
|
||||
});
|
||||
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId();
|
||||
|
||||
useEffect(() => {
|
||||
const monitorLookup = monitors?.reduce((acc, monitor) => {
|
||||
|
||||
@@ -272,7 +272,7 @@ class NetworkService {
|
||||
* @returns {Promise<AxiosResponse>} The response from the axios DELETE request.
|
||||
*/
|
||||
async deleteChecksByTeamId(config) {
|
||||
return this.axiosInstance.delete(`/checks/team/${config.teamId}`, {
|
||||
return this.axiosInstance.delete(`/checks/team`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
@@ -595,7 +595,7 @@ class NetworkService {
|
||||
if (config.page) params.append("page", config.page);
|
||||
if (config.rowsPerPage) params.append("rowsPerPage", config.rowsPerPage);
|
||||
if (config.status !== undefined) params.append("status", config.status);
|
||||
return this.axiosInstance.get(`/checks/team/${config.teamId}?${params.toString()}`);
|
||||
return this.axiosInstance.get(`/checks/team?${params.toString()}`);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user