From 0aeb61a74c47178ef41d515bea0ca93e60ac13e2 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Wed, 23 Oct 2024 23:33:48 +0100 Subject: [PATCH] correct response code --- src/components/userLookup.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/userLookup.tsx b/src/components/userLookup.tsx index 595edba..0431bd2 100644 --- a/src/components/userLookup.tsx +++ b/src/components/userLookup.tsx @@ -661,15 +661,13 @@ const AddNote = (props: { player: Player }) => { confidential: confidential ? "true" : "false", }), }).then((response) => { - response.text().then((response) => { - refetch?.updateUser({ userCkey: ckey }); - setAdding(false); - if (response) { - global?.updateAndShowToast(`Added note to ${ckey}.`); - } else { - global?.updateAndShowToast(`Failed to add note.`); - } - }); + refetch?.updateUser({ userCkey: ckey }); + setAdding(false); + if (response.status == 202) { + global?.updateAndShowToast(`Added note to ${ckey}.`); + } else { + global?.updateAndShowToast(`Failed to add note.`); + } }); };