diff options
| author | Fuwn <[email protected]> | 2024-12-24 11:13:15 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-12-24 11:13:15 -0800 |
| commit | 2f65c444a5ff402e41c8b2dae431610b02bd2d5f (patch) | |
| tree | 1709db3a55579e5416cb25d8001759b256bf9ffb /src/lib/Data/AniList | |
| parent | fix(List): double guard total count setting overlap (diff) | |
| download | due.moe-2f65c444a5ff402e41c8b2dae431610b02bd2d5f.tar.xz due.moe-2f65c444a5ff402e41c8b2dae431610b02bd2d5f.zip | |
fix(wrapped): li::marker consistent colouring
Diffstat (limited to 'src/lib/Data/AniList')
| -rw-r--r-- | src/lib/Data/AniList/user.ts | 28 |
1 files changed, 13 insertions, 15 deletions
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<User | null> => { - 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<User | null> = } } } }` - }) }) - ).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<FullUser> => ( |