Skip to content
Snippets Groups Projects
Verified Commit a150b0c7 authored by Jonas Leder's avatar Jonas Leder
Browse files

fix graphql using localhost for api

parent 15b36397
No related branches found
No related tags found
1 merge request!9fix graphql using localhost for api
Pipeline #7248 passed
......@@ -17,7 +17,7 @@ class blogFooter extends HTMLElement {
method: 'POST',
body: graphql,
};
let posts = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.blogPosts;
let posts = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.blogPosts;
posts.forEach((element) => {
let li = document.createElement("li");
let a = document.createElement("a");
......
......@@ -16,7 +16,7 @@ class BlogIndex extends HTMLElement {
method: 'POST',
body: graphql,
};
let posts = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.blogPosts;
let posts = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.blogPosts;
posts.forEach((element) => {
const article = document.createElement("article");
article.classList.add("breakWord");
......
......@@ -15,7 +15,7 @@ class commentsDisplay extends HTMLElement {
method: 'POST',
body: graphql,
};
let comments = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.comments;
let comments = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.comments;
this.innerHTML = "";
comments.forEach((element) => {
const h3 = document.createElement("h3");
......
......@@ -12,7 +12,7 @@ class ebkBanner extends HTMLElement {
method: 'POST',
body: graphql,
};
let elementCount = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.ebayKleinanzeigen.count;
let elementCount = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.ebayKleinanzeigen.count;
if(elementCount > 0) {
const h2 = document.createElement("h2");
h2.classList.add("red");
......
......@@ -117,7 +117,7 @@ class newComment extends HTMLElement {
method: 'POST',
body: graphql,
};
let data = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data;
let data = (await (await fetch("/API/graphql.php", requestOptions)).json()).data;
if(data.newComment == "OK"){
document.querySelector("jl-comments_display").getComments();
parent.innerHTML = "<jl-new_comment></jl-new_comment>"
......
......@@ -60,7 +60,7 @@ class sellingTable extends HTMLElement {
method: 'POST',
body: graphql,
};
let elements = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.ebayKleinanzeigen.elements;
let elements = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.ebayKleinanzeigen.elements;
elements.forEach(ad => {
const tr = document.createElement("tr");
table.appendChild(tr);
......
......@@ -36,7 +36,7 @@ async function loadPost() {
method: 'POST',
body: graphql,
};
let post = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.blogPost;
let post = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.blogPost;
content.innerHTML = post["content"];
document.title = post["title"] + " - Jonas Leder";
......
......@@ -60,7 +60,7 @@
method: 'POST',
body: graphql,
};
let mailAddress = (await (await fetch("http://localhost:1234/API/graphql.php", requestOptions)).json()).data.mailAddress;
let mailAddress = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.mailAddress;
let button = document.getElementById("emailButton");
let emailElement = document.createElement("p");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment