Fixed endpoint for getting coverart queue data #143

Merged
kdeng00 merged 6 commits from coverart_queue_data_endpoint_fix into v0.2 2025-06-17 21:40:49 -04:00
2 changed files with 0 additions and 54 deletions
Showing only changes of commit c22f522bad - Show all commits
-38
View File
@@ -470,44 +470,6 @@ pub mod endpoint {
(axum::http::StatusCode::BAD_REQUEST, axum::response::Response::default()) (axum::http::StatusCode::BAD_REQUEST, axum::response::Response::default())
} }
} }
/*
match params.id {
Some(id) => match super::db::get_coverart_queue_data_with_id(&pool, &id).await {
Ok(cover_art_queue) => {
response.message = String::from("Successful");
response.data.push(cover_art_queue);
(axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message = err.to_string();
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
},
_ => match params.song_queue_id {
Some(song_queue_id) => match super::db::get_coverart_queue_data_with_song_queue_id(
&pool,
&song_queue_id,
)
.await
{
Ok(cover_art_queue) => {
response.message = String::from("Successful");
response.data.push(cover_art_queue);
(axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message = err.to_string();
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
},
None => {
response.message = String::from("No valid id provided");
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
},
}
*/
} }
pub async fn create_coverart( pub async fn create_coverart(
-16
View File
@@ -1258,12 +1258,8 @@ mod tests {
"Should not be empty" "Should not be empty"
); );
// let uri = format!("{}/{}", crate::callers::endpoints::QUEUECOVERARTDATA, resp_coverart_id);
let raw_uri = String::from(crate::callers::endpoints::QUEUECOVERARTDATA); let raw_uri = String::from(crate::callers::endpoints::QUEUECOVERARTDATA);
let end_index = raw_uri.len() - 5; let end_index = raw_uri.len() - 5;
// let mut uri: String = (&raw_uri[..end_index]).to_string();
// uri += &id.to_string();
let uri = format!("{}/{}", (&raw_uri[..end_index]).to_string(), resp_coverart_id); let uri = format!("{}/{}", (&raw_uri[..end_index]).to_string(), resp_coverart_id);
println!("Uri: {:?}", uri); println!("Uri: {:?}", uri);
@@ -1294,18 +1290,6 @@ mod tests {
assert!(false, "Error: {:?}", err); assert!(false, "Error: {:?}", err);
} }
} }
/*
let resp = get_resp_data::<
crate::callers::coverart::response::fetch_coverart_with_data::Response,
>(response)
.await;
assert_eq!(
false,
resp.data.is_empty(),
"Should not be empty"
);
*/
} }
Err(err) => { Err(err) => {
assert!(false, "Error: {:?}", err); assert!(false, "Error: {:?}", err);