From 8f0acbcc82b839870faf7f3a151bd96d5d4e8159 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Tue, 26 Dec 2023 00:52:57 +0530 Subject: [PATCH] minor fixes --- ui/app/mirrors/errors/[mirrorName]/ackbutton.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/app/mirrors/errors/[mirrorName]/ackbutton.tsx b/ui/app/mirrors/errors/[mirrorName]/ackbutton.tsx index de8402db3f..b6d14eed89 100644 --- a/ui/app/mirrors/errors/[mirrorName]/ackbutton.tsx +++ b/ui/app/mirrors/errors/[mirrorName]/ackbutton.tsx @@ -17,14 +17,15 @@ const AckButton = ({ ack, id }: { ack: boolean; id: number | bigint }) => { // handleAck updates ack to true for the given mirrorID const handleAck = async (mirrorID: bigint | number) => { setLoading(true); - const updateRes = await fetch('/api/mirrors/alerts', { + const updateResResult = await fetch('/api/mirrors/alerts', { method: 'PUT', body: JSON.stringify({ mirrorIDStringList: [mirrorID.toString()], }), - }).then((res) => res.json()); + }); + const updateRes = await updateResResult.json(); setLoading(false); - if (!updateRes || updateRes === 0) { + if (!updateRes) { notifyErr('Something went wrong when trying to acknowledge'); return; }