From 7a6204285b9ac39466bd569a9a28fce479a0a1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Boquizo=20S=C3=A1nchez?= Date: Thu, 13 Jun 2024 22:08:46 +0200 Subject: [PATCH] feat(getAchievementUnlocks): add new query params --- src/achievement/getAchievementUnlocks.test.ts | 2 ++ src/achievement/getAchievementUnlocks.ts | 2 +- src/achievement/models/achievement-unlock-entity.model.ts | 1 + .../models/get-achievement-unlocks-response.model.ts | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/achievement/getAchievementUnlocks.test.ts b/src/achievement/getAchievementUnlocks.test.ts index cbfe1fb..48baddc 100644 --- a/src/achievement/getAchievementUnlocks.test.ts +++ b/src/achievement/getAchievementUnlocks.test.ts @@ -45,6 +45,7 @@ describe("Function: getAchievementUnlocks", () => { { User: "Tiotroll2022", RAPoints: "348", + RASoftcorePoints: "363", DateAwarded: "2023-01-29 21:45:41", HardcoreMode: "0", }, @@ -91,6 +92,7 @@ describe("Function: getAchievementUnlocks", () => { { user: "Tiotroll2022", raPoints: 348, + raSoftcorePoints: 363, dateAwarded: "2023-01-29 21:45:41", hardcoreMode: false, }, diff --git a/src/achievement/getAchievementUnlocks.ts b/src/achievement/getAchievementUnlocks.ts index 6e76af2..27a73d0 100644 --- a/src/achievement/getAchievementUnlocks.ts +++ b/src/achievement/getAchievementUnlocks.ts @@ -75,7 +75,7 @@ export const getAchievementUnlocks = async ( const rawResponse = await call({ url }); return serializeProperties(rawResponse, { - shouldCastToNumbers: ["ID", "Points", "TrueRatio", "RAPoints"], + shouldCastToNumbers: ["ID", "Points", "TrueRatio", "RAPoints", "RASoftcorePoints"], shouldMapToBooleans: ["HardcoreMode"], }); }; diff --git a/src/achievement/models/achievement-unlock-entity.model.ts b/src/achievement/models/achievement-unlock-entity.model.ts index 9d6bcb5..78a7954 100644 --- a/src/achievement/models/achievement-unlock-entity.model.ts +++ b/src/achievement/models/achievement-unlock-entity.model.ts @@ -1,6 +1,7 @@ export interface AchievementUnlockEntity { user: string; raPoints: number; + raSoftcorePoints: number; dateAwarded: string; hardcoreMode: boolean; } diff --git a/src/achievement/models/get-achievement-unlocks-response.model.ts b/src/achievement/models/get-achievement-unlocks-response.model.ts index 57d034a..f92fc17 100644 --- a/src/achievement/models/get-achievement-unlocks-response.model.ts +++ b/src/achievement/models/get-achievement-unlocks-response.model.ts @@ -1,6 +1,7 @@ interface AchievementUnlocksResponseEntity { User: string; RAPoints: string; + RASoftcorePoints: string; DateAwarded: string; HardcoreMode: string; }