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()) |
|
} |
|
} |
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 ofAchievementUnlockedPayloadfor a service.ZPI/src/dto/achievement.rs
Lines 87 to 95 in c2e89dd