Skip to content

Commit 0aeb61a

Browse files
committed
correct response code
1 parent b64b879 commit 0aeb61a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/components/userLookup.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,15 +661,13 @@ const AddNote = (props: { player: Player }) => {
661661
confidential: confidential ? "true" : "false",
662662
}),
663663
}).then((response) => {
664-
response.text().then((response) => {
665-
refetch?.updateUser({ userCkey: ckey });
666-
setAdding(false);
667-
if (response) {
668-
global?.updateAndShowToast(`Added note to ${ckey}.`);
669-
} else {
670-
global?.updateAndShowToast(`Failed to add note.`);
671-
}
672-
});
664+
refetch?.updateUser({ userCkey: ckey });
665+
setAdding(false);
666+
if (response.status == 202) {
667+
global?.updateAndShowToast(`Added note to ${ckey}.`);
668+
} else {
669+
global?.updateAndShowToast(`Failed to add note.`);
670+
}
673671
});
674672
};
675673

0 commit comments

Comments
 (0)