redirect on error
This commit is contained in:
1 parent
2732d5f64c
commit
4fd8d44012
1 file changed
+4
@@ -9,6 +9,7 @@ import { useSelector } from "react-redux";
|
|||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
import PulseDot from "../../../Components/Animated/PulseDot";
|
import PulseDot from "../../../Components/Animated/PulseDot";
|
||||||
import useUtils from "../../Monitors/utils";
|
import useUtils from "../../Monitors/utils";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
import Empty from "./empty";
|
import Empty from "./empty";
|
||||||
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
|
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
|
||||||
import {
|
import {
|
||||||
@@ -163,6 +164,7 @@ GaugeBox.propTypes = {
|
|||||||
* @returns {React.ReactElement} Infrastructure details page component
|
* @returns {React.ReactElement} Infrastructure details page component
|
||||||
*/
|
*/
|
||||||
const InfrastructureDetails = () => {
|
const InfrastructureDetails = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { monitorId } = useParams();
|
const { monitorId } = useParams();
|
||||||
const navList = [
|
const navList = [
|
||||||
@@ -200,6 +202,8 @@ const InfrastructureDetails = () => {
|
|||||||
|
|
||||||
setMonitor(response.data.data);
|
setMonitor(response.data.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
navigate("/not-found", { replace: true });
|
||||||
|
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user