Skip to content

Commit 29d9910

Browse files
feat(getAchievementUnlocks): add new query params (#101)
1 parent 8d88387 commit 29d9910

8 files changed

+20
-2
lines changed

src/achievement/getAchievementUnlocks.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe("Function: getAchievementUnlocks", () => {
4545
{
4646
User: "Tiotroll2022",
4747
RAPoints: "348",
48+
RASoftcorePoints: "363",
4849
DateAwarded: "2023-01-29 21:45:41",
4950
HardcoreMode: "0",
5051
},
@@ -91,6 +92,7 @@ describe("Function: getAchievementUnlocks", () => {
9192
{
9293
user: "Tiotroll2022",
9394
raPoints: 348,
95+
raSoftcorePoints: 363,
9496
dateAwarded: "2023-01-29 21:45:41",
9597
hardcoreMode: false,
9698
},

src/achievement/getAchievementUnlocks.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ export const getAchievementUnlocks = async (
7575
const rawResponse = await call<GetAchievementUnlocksResponse>({ url });
7676

7777
return serializeProperties(rawResponse, {
78-
shouldCastToNumbers: ["ID", "Points", "TrueRatio", "RAPoints"],
78+
shouldCastToNumbers: [
79+
"ID",
80+
"Points",
81+
"TrueRatio",
82+
"RAPoints",
83+
"RASoftcorePoints",
84+
],
7985
shouldMapToBooleans: ["HardcoreMode"],
8086
});
8187
};

src/achievement/models/achievement-unlock-entity.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export interface AchievementUnlockEntity {
22
user: string;
33
raPoints: number;
4+
raSoftcorePoints: number;
45
dateAwarded: string;
56
hardcoreMode: boolean;
67
}

src/achievement/models/get-achievement-unlocks-response.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
interface AchievementUnlocksResponseEntity {
22
User: string;
33
RAPoints: string;
4+
RASoftcorePoints: string;
45
DateAwarded: string;
56
HardcoreMode: string;
67
}

src/feed/getAchievementOfTheWeek.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe("Function: getAchievementOfTheWeek", () => {
5353
{
5454
User: "Tirbaba2",
5555
RAPoints: "72",
56+
RASoftcorePoints: "72",
5657
DateAwarded: "2022-10-10 01:42:19",
5758
HardcoreMode: "1",
5859
},
@@ -91,6 +92,7 @@ describe("Function: getAchievementOfTheWeek", () => {
9192
{
9293
user: "Tirbaba2",
9394
raPoints: 72,
95+
raSoftcorePoints: 72,
9496
dateAwarded: "2022-10-10 01:42:19",
9597
hardcoreMode: true,
9698
},
@@ -131,6 +133,7 @@ describe("Function: getAchievementOfTheWeek", () => {
131133
{
132134
User: "Tirbaba2",
133135
RAPoints: "72",
136+
RASoftcorePoints: "72",
134137
DateAwarded: "2022-10-10 01:42:19",
135138
HardcoreMode: "0",
136139
},
@@ -169,6 +172,7 @@ describe("Function: getAchievementOfTheWeek", () => {
169172
{
170173
user: "Tirbaba2",
171174
raPoints: 72,
175+
raSoftcorePoints: 72,
172176
dateAwarded: "2022-10-10 01:42:19",
173177
hardcoreMode: false,
174178
},

src/feed/getAchievementOfTheWeek.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ import type {
4848
* unlocks: [
4949
* {
5050
* user: "Tirbaba2",
51-
* rAPoints: "72",
51+
* raPoints: "72",
52+
* raSoftcorePoints: "72",
5253
* dateAwarded: "2022-10-10 01:42:19",
5354
* hardcoreMode: "1"
5455
* }
@@ -75,6 +76,7 @@ export const getAchievementOfTheWeek = async (
7576
"TrueRatio",
7677
"TotalPlayers",
7778
"RAPoints",
79+
"RASoftcorePoints",
7880
"UnlocksCount",
7981
],
8082
shouldMapToBooleans: ["HardcoreMode"],

src/feed/models/achievement-of-the-week.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface AchievementOfTheWeek {
2121
unlocks: Array<{
2222
user: string;
2323
raPoints: number;
24+
raSoftcorePoints: number;
2425
dateAwarded: string;
2526
hardcoreMode: boolean;
2627
}>;

src/feed/models/get-achievement-of-the-week-response.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface GetAchievementOfTheWeekResponse {
2121
Unlocks: Array<{
2222
User: string;
2323
RAPoints: string;
24+
RASoftcorePoints: string;
2425
DateAwarded: string;
2526
HardcoreMode: string;
2627
}>;

0 commit comments

Comments
 (0)