aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/anilist/increment/+server.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-09-13 02:02:14 -0700
committerFuwn <[email protected]>2023-09-13 02:02:14 -0700
commit475c198edf1f64d18a80bb8c912d743dcabe01f3 (patch)
tree8610f9d08f0405f97a943d86ba8f4bf0fe30d2f3 /src/routes/api/anilist/increment/+server.ts
parentrefactor(auth): move to single path (diff)
downloaddue.moe-475c198edf1f64d18a80bb8c912d743dcabe01f3.tar.xz
due.moe-475c198edf1f64d18a80bb8c912d743dcabe01f3.zip
refactor(anilist): move to single path
Diffstat (limited to 'src/routes/api/anilist/increment/+server.ts')
-rw-r--r--src/routes/api/anilist/increment/+server.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/routes/api/anilist/increment/+server.ts b/src/routes/api/anilist/increment/+server.ts
deleted file mode 100644
index 4680236b..00000000
--- a/src/routes/api/anilist/increment/+server.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export const GET = async ({ url, cookies }) => {
- const userCookie = cookies.get('user');
-
- if (!userCookie) {
- return new Response('Unauthenticated', { status: 401 });
- }
-
- const user = JSON.parse(userCookie);
-
- return Response.json(
- await (
- await fetch('https://graphql.anilist.co', {
- method: 'POST',
- headers: {
- Authorization: `${user['token_type']} ${user['access_token']}`,
- 'Content-Type': 'application/json',
- Accept: 'application/json'
- },
- body: JSON.stringify({
- query: `mutation { SaveMediaListEntry(mediaId: ${
- url.searchParams.get('id') || 'null'
- }, progress: ${url.searchParams.get('progress') || 'null'}) { id } }`
- })
- })
- ).json()
- );
-};