diff --git a/src/callers/queue/song.rs b/src/callers/queue/song.rs index d02df3c..a483baf 100644 --- a/src/callers/queue/song.rs +++ b/src/callers/queue/song.rs @@ -37,17 +37,16 @@ pub mod request { } } - pub mod response { pub mod song_queue { - /// Song queue response - #[derive(Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] - pub struct Response { - pub message: String, - /// Id of the queued song - pub data: Vec, - } + /// Song queue response + #[derive(Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] + pub struct Response { + pub message: String, + /// Id of the queued song + pub data: Vec, + } } pub mod fetch_queue_song { @@ -99,7 +98,6 @@ pub mod response { } } - pub mod endpoint { use axum::response::IntoResponse; @@ -121,7 +119,10 @@ pub mod endpoint { pub async fn queue_song( axum::Extension(pool): axum::Extension, mut multipart: axum::extract::Multipart, - ) -> (axum::http::StatusCode, axum::Json) { + ) -> ( + axum::http::StatusCode, + axum::Json, + ) { let mut results: Vec = Vec::new(); let mut response = super::response::song_queue::Response::default(); @@ -186,8 +187,7 @@ pub mod endpoint { match repo::song::get_song_queue(&pool, &payload.song_queue_id).await { Ok(song_queue) => { - match repo::song::link_user_id(&pool, &song_queue.id, &payload.user_id).await - { + match repo::song::link_user_id(&pool, &song_queue.id, &payload.user_id).await { Ok(user_id) => { response.message = String::from(crate::callers::response::SUCCESSFUL); response.data.push(user_id); @@ -271,7 +271,10 @@ pub mod endpoint { (axum::http::StatusCode::OK, response) } - Err(_err) => (axum::http::StatusCode::BAD_REQUEST, axum::response::Response::default()), + Err(_err) => ( + axum::http::StatusCode::BAD_REQUEST, + axum::response::Response::default(), + ), } } @@ -303,12 +306,8 @@ pub mod endpoint { if !id.is_nil() { match repo::song::get_status_of_song_queue(&pool, &id).await { Ok(old) => { - match repo::song::update_song_queue_status( - &pool, - &payload.status, - &id, - ) - .await + match repo::song::update_song_queue_status(&pool, &payload.status, &id) + .await { Ok(new) => { response.message = String::from("Successful"); diff --git a/src/callers/song.rs b/src/callers/song.rs index ba740cc..1da626b 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -7,8 +7,6 @@ pub mod request { pub message: String, } - - pub mod create_metadata { #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Request { @@ -68,7 +66,6 @@ pub mod request { } } - pub mod get_songs { #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Params { @@ -86,7 +83,6 @@ pub mod response { } } - pub mod get_songs { #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] pub struct Response { @@ -120,7 +116,6 @@ pub mod endpoint { use crate::repo; use crate::repo::queue as repo_queue; - /// Endpoint to create song #[utoipa::path( post, @@ -204,7 +199,6 @@ pub mod endpoint { } } - // Endpoint to get songs #[utoipa::path( get, diff --git a/src/main.rs b/src/main.rs index 2dadcb1..834d706 100644 --- a/src/main.rs +++ b/src/main.rs @@ -178,9 +178,10 @@ pub mod init { ) .route( crate::callers::queue::endpoints::QUEUESONGDATAWIPE, - patch(crate::callers::queue::song::endpoint::wipe_data_from_song_queue).route_layer( - axum::middleware::from_fn(crate::auth::auth::), - ), + patch(crate::callers::queue::song::endpoint::wipe_data_from_song_queue) + .route_layer(axum::middleware::from_fn( + crate::auth::auth::, + )), ) .route( crate::callers::endpoints::QUEUEMETADATA,