From 13562f4e900cb09a3a276af5c9724e048c0a7a00 Mon Sep 17 00:00:00 2001 From: Wes Copeland Date: Sun, 14 Jan 2024 12:04:43 -0500 Subject: [PATCH] feat(getGameExtended): add support for unofficial achievements param (#63) --- src/game/getGameExtended.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/game/getGameExtended.ts b/src/game/getGameExtended.ts index 15b4930..1def77b 100644 --- a/src/game/getGameExtended.ts +++ b/src/game/getGameExtended.ts @@ -73,17 +73,23 @@ import type { GameExtended, GetGameExtendedResponse } from "./models"; */ export const getGameExtended = async ( authorization: AuthObject, - payload: { gameId: ID } + payload: { gameId: ID; isRequestingUnofficialAchievements: boolean } ): Promise => { - const { gameId } = payload; + const { gameId, isRequestingUnofficialAchievements } = payload; + + const params: Record = { + i: gameId + }; + + if (isRequestingUnofficialAchievements) { + params["f"] = 5; + } const url = buildRequestUrl( apiBaseUrl, "/API_GetGameExtended.php", authorization, - { - i: gameId - } + params ); const rawResponse = await call({ url });