Skip to content

endpoint to get all achievements with unlocked/locked info for a service #40

@hanneskt

Description

@hanneskt

so users can see which achievements they have and haven't unlocked for a service

Here, add a function for_service. It should return a list of AchievementUnlockedPayload for a service.

impl AchievementUnlockedPayload {
pub async fn for_user(
db: &Database,
user_id: u32,
) -> Result<Vec<AchievementUnlockedPayload>, AppError> {
let rows = db.achievements().unlocked_for_user(user_id).await?;
Ok(unpack_achievements(rows).collect())
}
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions