From d718e0017c9db2ee43a6be3a6a41f4bc6c3c7850 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Wed, 29 Oct 2025 14:53:59 -0400 Subject: [PATCH] tsk-213: Minor status code changes --- src/callers/queue/song.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/callers/queue/song.rs b/src/callers/queue/song.rs index 9e6ba8b..1dcf38d 100644 --- a/src/callers/queue/song.rs +++ b/src/callers/queue/song.rs @@ -166,10 +166,7 @@ pub mod endpoint { results.push(queue_repo); } else { response.message = String::from("Invalid song type"); - return ( - axum::http::StatusCode::INTERNAL_SERVER_ERROR, - axum::Json(response), - ); + return (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)); } } Err(err) => { @@ -426,15 +423,15 @@ pub mod endpoint { } Err(err) => { response.message = err.to_string(); - (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) + ( + axum::http::StatusCode::INTERNAL_SERVER_ERROR, + axum::Json(response), + ) } } } else { response.message = String::from("Invalid song type"); - ( - axum::http::StatusCode::INTERNAL_SERVER_ERROR, - axum::Json(response), - ) + (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) } } Err(err) => {