Skip to content

Commit

Permalink
feat(getAchievementOfTheWeek): add new query params
Browse files Browse the repository at this point in the history
  • Loading branch information
gboquizosanchez committed Jun 13, 2024
1 parent 7a62042 commit b5fb060
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/achievement/getAchievementUnlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ export const getAchievementUnlocks = async (
const rawResponse = await call<GetAchievementUnlocksResponse>({ url });

return serializeProperties(rawResponse, {
shouldCastToNumbers: ["ID", "Points", "TrueRatio", "RAPoints", "RASoftcorePoints"],
shouldCastToNumbers: [
"ID",
"Points",
"TrueRatio",
"RAPoints",
"RASoftcorePoints",
],
shouldMapToBooleans: ["HardcoreMode"],
});
};
4 changes: 4 additions & 0 deletions src/feed/getAchievementOfTheWeek.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe("Function: getAchievementOfTheWeek", () => {
{
User: "Tirbaba2",
RAPoints: "72",
RASoftcorePoints: "72",
DateAwarded: "2022-10-10 01:42:19",
HardcoreMode: "1",
},
Expand Down Expand Up @@ -91,6 +92,7 @@ describe("Function: getAchievementOfTheWeek", () => {
{
user: "Tirbaba2",
raPoints: 72,
raSoftcorePoints: 72,
dateAwarded: "2022-10-10 01:42:19",
hardcoreMode: true,
},
Expand Down Expand Up @@ -131,6 +133,7 @@ describe("Function: getAchievementOfTheWeek", () => {
{
User: "Tirbaba2",
RAPoints: "72",
RaSoftcorePoints: "72",
DateAwarded: "2022-10-10 01:42:19",
HardcoreMode: "0",
},
Expand Down Expand Up @@ -169,6 +172,7 @@ describe("Function: getAchievementOfTheWeek", () => {
{
user: "Tirbaba2",
raPoints: 72,
raSoftcorePoints: 72,
dateAwarded: "2022-10-10 01:42:19",
hardcoreMode: false,
},
Expand Down
4 changes: 3 additions & 1 deletion src/feed/getAchievementOfTheWeek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ import type {
* unlocks: [
* {
* user: "Tirbaba2",
* rAPoints: "72",
* raPoints: "72",
* raSoftcorePoints: "72",
* dateAwarded: "2022-10-10 01:42:19",
* hardcoreMode: "1"
* }
Expand All @@ -75,6 +76,7 @@ export const getAchievementOfTheWeek = async (
"TrueRatio",
"TotalPlayers",
"RAPoints",
"RASoftcorePoints",
"UnlocksCount",
],
shouldMapToBooleans: ["HardcoreMode"],
Expand Down
1 change: 1 addition & 0 deletions src/feed/models/achievement-of-the-week.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface AchievementOfTheWeek {
unlocks: Array<{
user: string;
raPoints: number;
raSoftcorePoints: number;
dateAwarded: string;
hardcoreMode: boolean;
}>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GetAchievementOfTheWeekResponse {
Unlocks: Array<{
User: string;
RAPoints: string;
RASoftcorePoints: string;
DateAwarded: string;
HardcoreMode: string;
}>;
Expand Down

0 comments on commit b5fb060

Please sign in to comment.