summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/album.rs3
-rw-r--r--src/api/artist.rs3
-rw-r--r--src/api/search_results.rs12
-rw-r--r--src/api/song.rs3
4 files changed, 14 insertions, 7 deletions
diff --git a/src/api/album.rs b/src/api/album.rs
index b395010..2c6dfbb 100644
--- a/src/api/album.rs
+++ b/src/api/album.rs
@@ -1,5 +1,6 @@
use crate::api::{get_response_from_query, Response};
-use crate::database::{Album, AlbumPost, AlbumPut, Delete};
+use crate::database::Delete;
+use crate::database::album::{Album, AlbumPost, AlbumPut};
use crate::extractors::auth_token::AuthenticationToken;
use crate::AppState;
use actix_web::{delete, get, post, put, web, HttpResponse};
diff --git a/src/api/artist.rs b/src/api/artist.rs
index 6cc0f35..e8e5009 100644
--- a/src/api/artist.rs
+++ b/src/api/artist.rs
@@ -1,5 +1,6 @@
use crate::api::{get_response_from_query, Response};
-use crate::database::{Artist, ArtistPost, ArtistPut, Delete};
+use crate::database::Delete;
+use crate::database::artist::{Artist, ArtistPost, ArtistPut};
use crate::extractors::auth_token::AuthenticationToken;
use crate::AppState;
use actix_web::{delete, get, post, put, web, HttpResponse};
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((
diff --git a/src/api/song.rs b/src/api/song.rs
index 3748210..e046d22 100644
--- a/src/api/song.rs
+++ b/src/api/song.rs
@@ -1,5 +1,6 @@
use crate::api::{get_response_from_query, Response};
-use crate::database::{Delete, Song, SongPost, SongPut};
+use crate::database::Delete;
+use crate::database::song::{Song, SongPost, SongPut};
use crate::extractors::auth_token::AuthenticationToken;
use crate::AppState;
use actix_web::{delete, get, post, put, web, HttpResponse};