Remove last conditional graphql use

This commit is contained in:
Jordan Eldredge 2022-04-01 23:42:51 -07:00
parent 64908e8777
commit 6f83eeddbb
2 changed files with 6 additions and 16 deletions

View file

@ -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() {

View file

@ -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";