remove monitor from hook
This commit is contained in:
1 parent
85a428dd92
commit
6db850dd4d
1 file changed
+1
-3
@@ -5,12 +5,10 @@ import { createToast } from "../Utils/toastUtils";
|
|||||||
const usePauseMonitor = ({ monitorId, triggerUpdate }) => {
|
const usePauseMonitor = ({ monitorId, triggerUpdate }) => {
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [error, setError] = useState(undefined);
|
const [error, setError] = useState(undefined);
|
||||||
const [monitor, setMonitor] = useState(undefined);
|
|
||||||
const pauseMonitor = async () => {
|
const pauseMonitor = async () => {
|
||||||
try {
|
try {
|
||||||
setIsLoading(false);
|
setIsLoading(true);
|
||||||
const res = await networkService.pauseMonitorById({ monitorId });
|
const res = await networkService.pauseMonitorById({ monitorId });
|
||||||
setMonitor(res.data.data);
|
|
||||||
createToast({
|
createToast({
|
||||||
body: res.data.data.isActive
|
body: res.data.data.isActive
|
||||||
? "Monitor resumed successfully"
|
? "Monitor resumed successfully"
|
||||||
|
|||||||
Reference in new issue
Block a user