From d492162b20653a6d2bfc1532e5331d600cda265b Mon Sep 17 00:00:00 2001 From: nicolasito1411 <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Mon, 2 Oct 2023 20:04:30 +0200 Subject: [PATCH] fix: get_completed_quests output format --- src/endpoints/get_completed_quests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/endpoints/get_completed_quests.rs b/src/endpoints/get_completed_quests.rs index fd2efb73..28214e53 100644 --- a/src/endpoints/get_completed_quests.rs +++ b/src/endpoints/get_completed_quests.rs @@ -78,9 +78,9 @@ pub async fn handler( let tasks_collection = state.db.collection::("completed_tasks"); match tasks_collection.aggregate(pipeline, None).await { Ok(mut cursor) => { - let mut quests: Vec = Vec::new(); + let mut quests: Vec = 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() }