diff options
| author | Fuwn <[email protected]> | 2024-01-05 19:41:11 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-05 19:41:11 -0800 |
| commit | 12cf6f1531c00d84bf1deb2e08815d38492bd58c (patch) | |
| tree | 69d87e311e9b41c9107989b96f38556d0787e9e0 /src/lib/AniList | |
| parent | feat(css): better shadow (diff) | |
| download | due.moe-12cf6f1531c00d84bf1deb2e08815d38492bd58c.tar.xz due.moe-12cf6f1531c00d84bf1deb2e08815d38492bd58c.zip | |
feat(css): navigation avatar
Diffstat (limited to 'src/lib/AniList')
| -rw-r--r-- | src/lib/AniList/identity.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/AniList/identity.ts b/src/lib/AniList/identity.ts index a77891d6..7214ffa4 100644 --- a/src/lib/AniList/identity.ts +++ b/src/lib/AniList/identity.ts @@ -1,6 +1,7 @@ export interface UserIdentity { id: number; name: string; + avatar: string; } export interface AniListAuthorisation { @@ -21,12 +22,13 @@ export const userIdentity = async ( 'Content-Type': 'application/json', Accept: 'application/json' }, - body: JSON.stringify({ query: `{ Viewer { id name } }` }) + body: JSON.stringify({ query: `{ Viewer { id name avatar { large } } }` }) }) ).json(); return { id: userIdResponse['data']['Viewer']['id'], - name: userIdResponse['data']['Viewer']['name'] + name: userIdResponse['data']['Viewer']['name'], + avatar: userIdResponse['data']['Viewer']['avatar']['large'] }; }; |