Skip to content

Commit

Permalink
Refactor KindlyForm.js to handle flag status
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfletcher committed Mar 22, 2024
1 parent ec889b0 commit a08ada9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/KindlyForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ function KindlyForm(props) {
console.log(error);
});
}

fetch(KINDLY_URL, {
method: "POST",
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
Expand All @@ -269,9 +267,7 @@ function KindlyForm(props) {
.then((data) => {
console.log("Success:", data);

if (
parseFloat(data.result["offensive"]) > parseFloat(data.result["not-offensive"])
) {
if (data.class === "flag") {
ReactDOM.render(badStatus, kindlyStatus);
kindlyStatus.style.backgroundColor = "#ff9f40";
} else {
Expand Down

0 comments on commit a08ada9

Please sign in to comment.