fix: remove anime key in statistics key

This commit is contained in:
2024-09-21 20:04:21 -04:00
parent a740fa3e93
commit b8631b9614

View File

@@ -28,7 +28,10 @@ export function getUser(aniListToken: string) {
.request(GetUserQuery, undefined, {
Authorization: `Bearer ${aniListToken}`,
})
.then((data) => data?.Viewer)
.then((data) => ({
...data?.Viewer,
statistics: { ...data?.Viewer?.statistics?.anime },
}))
.catch((err) => {
if (err.response?.status === 401 || err.response?.status === 429) {
return null;