aboutsummaryrefslogtreecommitdiff
path: root/lib/AniList.js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-07-16 22:35:39 +0700
committerFactiven <[email protected]>2023-07-16 22:35:39 +0700
commit1eee181e219dfd993d396ac3169e7aad3dd285eb (patch)
tree23fe54e9c3f8810f3ac9ab6b29070b4f0d4b9d20 /lib/AniList.js
parentremoved console.log (diff)
downloadmoopa-1eee181e219dfd993d396ac3169e7aad3dd285eb.tar.xz
moopa-1eee181e219dfd993d396ac3169e7aad3dd285eb.zip
Update v3.6.4
- Added Manga page with a working tracker for AniList user - Added schedule component to home page - Added disqus comment section so you can fight on each other (not recommended) - Added /id and /en route for english and indonesian subs (id route still work in progress)
Diffstat (limited to 'lib/AniList.js')
-rw-r--r--lib/AniList.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/AniList.js b/lib/AniList.js
deleted file mode 100644
index f602dad..0000000
--- a/lib/AniList.js
+++ /dev/null
@@ -1,54 +0,0 @@
-export async function aniListData({ sort, page = 1 }) {
- const resAnilist = await fetch(`https://graphql.anilist.co`, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- query: `
- query (
- $id: Int
- $page: Int
- $perPage: Int
- $search: String
- $sort: [MediaSort]
- ) {
- Page(page: $page, perPage: $perPage) {
- pageInfo {
- total
- currentPage
- lastPage
- hasNextPage
- perPage
- }
- media(id: $id, search: $search, sort: $sort type: ANIME) {
- id
- idMal
- title {
- romaji
- english
- }
- coverImage {
- extraLarge
- }
- description
- }
- }
- }
- `,
- variables: {
- page: page,
- perPage: 15,
- sort,
- },
- }),
- });
- const anilistData = await resAnilist.json();
- const data = anilistData.data.Page.media;
- // console.log(resAnilist);
- return {
- props: {
- data,
- },
- };
-}