Skip to content

Commit

Permalink
feat(getGameExtended): add support for unofficial achievements param (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland authored Jan 14, 2024
1 parent cb7d289 commit 13562f4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/game/getGameExtended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GameExtended> => {
const { gameId } = payload;
const { gameId, isRequestingUnofficialAchievements } = payload;

const params: Record<string, string | number> = {
i: gameId
};

if (isRequestingUnofficialAchievements) {
params["f"] = 5;
}

const url = buildRequestUrl(
apiBaseUrl,
"/API_GetGameExtended.php",
authorization,
{
i: gameId
}
params
);

const rawResponse = await call<GetGameExtendedResponse>({ url });
Expand Down

0 comments on commit 13562f4

Please sign in to comment.