summaryrefslogtreecommitdiff
path: root/src/api/search_results.rs
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2025-01-25 20:50:21 +0100
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2025-01-25 20:50:21 +0100
commit57a2df34f4986f1f6062f22804021925afec0419 (patch)
treef72ba12f40d15248d25235ce711b0aec2a6137a9 /src/api/search_results.rs
parent8782579e326b55e182d5767a451b8864b3453cce (diff)
refactor database
Diffstat (limited to 'src/api/search_results.rs')
-rw-r--r--src/api/search_results.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/api/search_results.rs b/src/api/search_results.rs
index 585ba2c..8f01e56 100644
--- a/src/api/search_results.rs
+++ b/src/api/search_results.rs
@@ -1,4 +1,6 @@
-use crate::database::{Album, Artist, Song};
+use crate::database::album::Album;
+use crate::database::artist::Artist;
+use crate::database::song::Song;
use crate::AppState;
use actix_web::{get, web, HttpResponse};
use serde::Deserialize;
@@ -42,9 +44,11 @@ pub async fn search_results(
.search_results_by_name(&get_args.name.clone().unwrap())
.await
}
- _ => app_state.database.search_results().await, // Err(sqlx::Error::RowNotFound),
- // Err(sqlx::Error::RowNotFound),
- // Err(sqlx::Error::RowNotFound),
+ _ => (
+ Err(sqlx::Error::RowNotFound),
+ Err(sqlx::Error::RowNotFound),
+ Err(sqlx::Error::RowNotFound)
+ ),
};
return HttpResponse::Ok().json((