From c97f6168a128171d4c1e74cb6d57048094e458d4 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Fri, 16 Aug 2024 12:33:32 +0200 Subject: [PATCH] fix --- src/route/admin.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/route/admin.rs b/src/route/admin.rs index e06cd5e..50d108a 100644 --- a/src/route/admin.rs +++ b/src/route/admin.rs @@ -9,6 +9,7 @@ use crate::check_admin; use crate::library::track::Track; use crate::library::user::User; use crate::library::Libary; +use crate::route::to_api; #[get("/library/clean")] pub async fn clean_library(lib: &State, u: User) -> FallibleApiResponse { @@ -23,12 +24,13 @@ pub async fn get_singles_route(u: User) -> FallibleApiResponse { let singles = Track::find(doc! { "album_id": None::}, None) .await .unwrap(); - Ok(json!(singles)) + + Ok(json!(to_api(&singles).await)) } #[get("/library/orphans")] pub async fn get_orphans_route(u: User) -> FallibleApiResponse { check_admin!(u); let orphans = Track::get_orphans().await; - Ok(json!(orphans)) + Ok(json!(to_api(&orphans).await)) }