Skip to content

Update the example code in user-trophy-list.md#231

Open
fantasydr wants to merge 1 commit intoachievements-app:mainfrom
fantasydr:patch-1
Open

Update the example code in user-trophy-list.md#231
fantasydr wants to merge 1 commit intoachievements-app:mainfrom
fantasydr:patch-1

Conversation

@fantasydr
Copy link
Copy Markdown

  1. Fetch all title data when the total amount exceeds the call limit (100 titles per call for now).
  2. Add a hint for downloading data for the user's own account instead of "xelnia" in the example.

1. Fetch all data when the total amount exceeds the limit (100 titles per call for now).

2. Add a hint for downloading data for the user's own account instead of "xelnia" in the example.
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 12, 2026

@fantasydr is attempting to deploy a commit to the achievements-app Team on Vercel.

A member of the Team first needs to authorize it.

const { trophyTitles } = await getUserTitles(authorization, targetAccountId);

// Ensure all data is fetched when the totalItemCount exceeds the limit.
const allTitles: TrophyTitle[] = [];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be added to the example import block.

const allTitles: TrophyTitle[] = [];
let offset = 0;
while (true) {
const { totalItemCount, trophyTitles } = await getUserTitles( authorization, targetAccountId, { offset });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be more readable:

Suggested change
const { totalItemCount, trophyTitles } = await getUserTitles( authorization, targetAccountId, { offset });
const { totalItemCount, trophyTitles } = await getUserTitles(
authorization,
targetAccountId,
{ offset }
);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry for the late reply! I was caught up with a few other projects in March. Just wanted to check on the merging process for this repo—should I go ahead and update the commit, or were you planning to make the updates on your end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants