Skip to content

Commit

Permalink
correct response code
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Oct 23, 2024
1 parent b64b879 commit 0aeb61a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/components/userLookup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
}
});
};

Expand Down

0 comments on commit 0aeb61a

Please sign in to comment.