mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Remove last conditional graphql use
This commit is contained in:
parent
64908e8777
commit
6f83eeddbb
2 changed files with 6 additions and 16 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue