Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update DatedUserAchievement model to be an object #77

Merged

Conversation

minhaferzz
Copy link
Contributor

When calling getAchievementsEarnedBetween() and getAchievementsEarnedOnDay() the returned type is Promise<DatedUserAchievement[]>.

DatedUserAchievement is defined as:

export type DatedUserAchievement = {
    date: string;
    hardcoreMode: boolean;
    achievementId: number;
    title: string;
    description: string;
    badgeName: string;
    points: number;
    author: string;
    gameTitle: string;
    gameIcon: string;
    gameId: number;
    consoleName: string;
    cumulScore: number;
    badgeUrl: string;
    gameUrl: string;
}[];

This means the promise would return an array of arrays. This PR updates DatedUserAchievement to be simply an object so it is consistent with what the API returns.

Copy link
Member

@wescopeland wescopeland left a comment

Choose a reason for hiding this comment

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

Thanks 👍 I will get this into a release.

@wescopeland wescopeland merged commit bcffb62 into RetroAchievements:main Feb 25, 2024
1 check passed
@minhaferzz minhaferzz deleted the fix-dated-user-achievement-model branch February 26, 2024 03:27
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