summaryrefslogtreecommitdiff
path: root/src/api/album.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/album.rs')
-rw-r--r--src/api/album.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/api/album.rs b/src/api/album.rs
index 3f91cd0..b395010 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::extractors::auth_token::AuthenticationToken;
use crate::AppState;
use actix_web::{delete, get, post, put, web, HttpResponse};
use serde::Deserialize;
@@ -55,6 +56,7 @@ pub async fn get_album(
pub async fn post_album(
app_state: web::Data<AppState>,
request_data: web::Json<AlbumPost>,
+ _auth_token: AuthenticationToken,
) -> HttpResponse {
get_response_from_query(
app_state
@@ -69,9 +71,13 @@ pub async fn post_album(
pub async fn put_album(
app_state: web::Data<AppState>,
request_data: web::Json<AlbumPut>,
+ _auth_token: AuthenticationToken,
) -> HttpResponse {
get_response_from_query(
- app_state.database.edit_album(request_data.into_inner()).await,
+ app_state
+ .database
+ .edit_album(request_data.into_inner())
+ .await,
"PUT".to_string(),
)
}
@@ -80,6 +86,7 @@ pub async fn put_album(
pub async fn delete_album(
app_state: web::Data<AppState>,
request_data: web::Json<Delete>,
+ _auth_token: AuthenticationToken,
) -> HttpResponse {
/* Check if ID is valid (return -1 if invalid) */
let id: i32 = request_data