diff --git a/src/Feedback.js b/src/Feedback.js index c13cf4bf..8e8b2554 100644 --- a/src/Feedback.js +++ b/src/Feedback.js @@ -7,23 +7,14 @@ import { useActionCreator } from "./hooks"; import { useCallback } from "react"; import { useSelector } from "react-redux"; import { fetchGraphql, gql } from "./utils"; -import { USE_GRAPHQL } from "./constants"; async function sendFeedback(variables) { - if (USE_GRAPHQL) { - const mutation = gql` - mutation GiveFeedback($message: String!, $email: String, $url: String) { - send_feedback(message: $message, email: $email, url: $url) - } - `; - await fetchGraphql(mutation, variables); - } else { - await fetch(`${API_URL}/feedback`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(variables), - }); - } + const mutation = gql` + mutation GiveFeedback($message: String!, $email: String, $url: String) { + send_feedback(message: $message, email: $email, url: $url) + } + `; + await fetchGraphql(mutation, variables); } export default function Feedback() { diff --git a/src/constants.js b/src/constants.js index 267716c0..7933d68f 100644 --- a/src/constants.js +++ b/src/constants.js @@ -33,7 +33,6 @@ export const SCREENSHOT_CDN = "https://mirror.webampskins.org"; export const SKIN_CDN = params.vps ? "https://mirror.webampskins.org" : "https://cdn.webampskins.org"; -export const USE_GRAPHQL = Boolean(!params.rest); // Uncomment these if something goes wrong // export const SCREENSHOT_CDN = "https://cdn.webampskins.org"; // export const SKIN_CDN = "https://cdn.webampskins.org";