From b8631b9614432ab065402c9eec45d9f786c8641d Mon Sep 17 00:00:00 2001 From: Rushil Perera Date: Sat, 21 Sep 2024 20:04:21 -0400 Subject: [PATCH] fix: remove anime key in statistics key --- src/controllers/auth/anilist/getUser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/auth/anilist/getUser.ts b/src/controllers/auth/anilist/getUser.ts index 3aee298..0281278 100644 --- a/src/controllers/auth/anilist/getUser.ts +++ b/src/controllers/auth/anilist/getUser.ts @@ -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;