diff --git a/17th Website/src/api/request.js b/17th Website/src/api/request.js new file mode 100644 index 0000000..a9e80b5 --- /dev/null +++ b/17th Website/src/api/request.js @@ -0,0 +1,24 @@ +async function QueryApolloGraphQL (setName, query) { + return await fetch( + 'https://unit-tracker-api.iceberg-gaming.com/', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + cache: 'no-cache', + body: JSON.stringify({ + "query": query + }) + }) + .then(response => response.json()) + .then(response => { + return response.data[setName].items; + }) + .catch((error) => { + return console.error('Error:', error); + } + ); +} + +export default QueryApolloGraphQL \ No newline at end of file diff --git a/17th Website/src/components/ProfilePage/profile.vue b/17th Website/src/components/ProfilePage/profile.vue index af2c391..6a227d4 100644 --- a/17th Website/src/components/ProfilePage/profile.vue +++ b/17th Website/src/components/ProfilePage/profile.vue @@ -12,7 +12,13 @@ export default {