tsk-218: Code formatting

This commit is contained in:
kdeng00
2025-10-26 17:19:48 -04:00
parent 04dd4f89e4
commit 389ed2264e
3 changed files with 22 additions and 28 deletions
+10 -11
View File
@@ -37,7 +37,6 @@ pub mod request {
} }
} }
pub mod response { pub mod response {
pub mod song_queue { pub mod song_queue {
@@ -99,7 +98,6 @@ pub mod response {
} }
} }
pub mod endpoint { pub mod endpoint {
use axum::response::IntoResponse; use axum::response::IntoResponse;
@@ -121,7 +119,10 @@ pub mod endpoint {
pub async fn queue_song( pub async fn queue_song(
axum::Extension(pool): axum::Extension<sqlx::PgPool>, axum::Extension(pool): axum::Extension<sqlx::PgPool>,
mut multipart: axum::extract::Multipart, mut multipart: axum::extract::Multipart,
) -> (axum::http::StatusCode, axum::Json<super::response::song_queue::Response>) { ) -> (
axum::http::StatusCode,
axum::Json<super::response::song_queue::Response>,
) {
let mut results: Vec<uuid::Uuid> = Vec::new(); let mut results: Vec<uuid::Uuid> = Vec::new();
let mut response = super::response::song_queue::Response::default(); 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 { match repo::song::get_song_queue(&pool, &payload.song_queue_id).await {
Ok(song_queue) => { 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) => { Ok(user_id) => {
response.message = String::from(crate::callers::response::SUCCESSFUL); response.message = String::from(crate::callers::response::SUCCESSFUL);
response.data.push(user_id); response.data.push(user_id);
@@ -271,7 +271,10 @@ pub mod endpoint {
(axum::http::StatusCode::OK, response) (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,11 +306,7 @@ pub mod endpoint {
if !id.is_nil() { if !id.is_nil() {
match repo::song::get_status_of_song_queue(&pool, &id).await { match repo::song::get_status_of_song_queue(&pool, &id).await {
Ok(old) => { Ok(old) => {
match repo::song::update_song_queue_status( match repo::song::update_song_queue_status(&pool, &payload.status, &id)
&pool,
&payload.status,
&id,
)
.await .await
{ {
Ok(new) => { Ok(new) => {
-6
View File
@@ -7,8 +7,6 @@ pub mod request {
pub message: String, pub message: String,
} }
pub mod create_metadata { pub mod create_metadata {
#[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] #[derive(Debug, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
pub struct Request { pub struct Request {
@@ -68,7 +66,6 @@ pub mod request {
} }
} }
pub mod get_songs { pub mod get_songs {
#[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
pub struct Params { pub struct Params {
@@ -86,7 +83,6 @@ pub mod response {
} }
} }
pub mod get_songs { pub mod get_songs {
#[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)] #[derive(Debug, Default, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
pub struct Response { pub struct Response {
@@ -120,7 +116,6 @@ pub mod endpoint {
use crate::repo; use crate::repo;
use crate::repo::queue as repo_queue; use crate::repo::queue as repo_queue;
/// Endpoint to create song /// Endpoint to create song
#[utoipa::path( #[utoipa::path(
post, post,
@@ -204,7 +199,6 @@ pub mod endpoint {
} }
} }
// Endpoint to get songs // Endpoint to get songs
#[utoipa::path( #[utoipa::path(
get, get,
+4 -3
View File
@@ -178,9 +178,10 @@ pub mod init {
) )
.route( .route(
crate::callers::queue::endpoints::QUEUESONGDATAWIPE, crate::callers::queue::endpoints::QUEUESONGDATAWIPE,
patch(crate::callers::queue::song::endpoint::wipe_data_from_song_queue).route_layer( patch(crate::callers::queue::song::endpoint::wipe_data_from_song_queue)
axum::middleware::from_fn(crate::auth::auth::<axum::body::Body>), .route_layer(axum::middleware::from_fn(
), crate::auth::auth::<axum::body::Body>,
)),
) )
.route( .route(
crate::callers::endpoints::QUEUEMETADATA, crate::callers::endpoints::QUEUEMETADATA,