From 2f65c444a5ff402e41c8b2dae431610b02bd2d5f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 24 Dec 2024 11:13:15 -0800 Subject: fix(wrapped): li::marker consistent colouring --- src/lib/Data/AniList/user.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/lib/Data/AniList') diff --git a/src/lib/Data/AniList/user.ts b/src/lib/Data/AniList/user.ts index aaab6e0b..19de8c45 100644 --- a/src/lib/Data/AniList/user.ts +++ b/src/lib/Data/AniList/user.ts @@ -46,16 +46,15 @@ export interface FullUser { } export const user = async (username: string, id = false): Promise => { - const response = ( - await ( - await fetch('https://graphql.anilist.co', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json' - }, - body: JSON.stringify({ - query: `{ User(${id ? `id: ${username}` : `name: "${username}"`}) { + const response = await ( + await fetch('https://graphql.anilist.co', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json' + }, + body: JSON.stringify({ + query: `{ User(${id ? `id: ${username}` : `name: "${username}"`}) { name id bannerImage avatar { large medium } statistics { anime { count meanScore minutesWatched episodesWatched @@ -65,13 +64,12 @@ export const user = async (username: string, id = false): Promise = } } } }` - }) }) - ).json() - ) + }) + ).json(); - return response["data"]["User"] === null ? null : response["data"]["User"]; -} + return response['data']['User'] === null ? null : response['data']['User']; +}; export const dumpUser = async (username: string): Promise => ( -- cgit v1.2.3