Code formatting
This commit is contained in:
+2
-4
@@ -994,8 +994,7 @@ pub mod endpoint {
|
|||||||
let mut response = super::response::get_songs::Response::default();
|
let mut response = super::response::get_songs::Response::default();
|
||||||
|
|
||||||
match params.id {
|
match params.id {
|
||||||
Some(id) => {
|
Some(id) => match super::song_db::get_song(&pool, &id).await {
|
||||||
match super::song_db::get_song(&pool, &id).await {
|
|
||||||
Ok(song) => {
|
Ok(song) => {
|
||||||
response.data.push(song);
|
response.data.push(song);
|
||||||
(axum::http::StatusCode::OK, axum::Json(response))
|
(axum::http::StatusCode::OK, axum::Json(response))
|
||||||
@@ -1004,8 +1003,7 @@ pub mod endpoint {
|
|||||||
response.message = err.to_string();
|
response.message = err.to_string();
|
||||||
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
|
||||||
None => {
|
None => {
|
||||||
response.message = String::from("Invalid parameters");
|
response.message = String::from("Invalid parameters");
|
||||||
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
||||||
|
|||||||
Reference in New Issue
Block a user