Skip to content

Commit

Permalink
fix: get_completed_quests output format
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchand-Nicolas committed Oct 2, 2023
1 parent 618ab0f commit d492162
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/endpoints/get_completed_quests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ pub async fn handler(
let tasks_collection = state.db.collection::<Document>("completed_tasks");
match tasks_collection.aggregate(pipeline, None).await {
Ok(mut cursor) => {
let mut quests: Vec<Document> = Vec::new();
let mut quests: Vec<u32> = Vec::new();
while let Some(result) = cursor.try_next().await.unwrap() {
quests.push(result);
quests.push(result.get("quest_id").unwrap().as_i32().unwrap() as u32);
}
(StatusCode::OK, Json(quests)).into_response()
}
Expand Down

0 comments on commit d492162

Please sign in to comment.