Fixed endpoint for getting coverart queue data #143
@@ -470,44 +470,6 @@ pub mod endpoint {
|
||||
(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(
|
||||
|
||||
-16
@@ -1258,12 +1258,8 @@ mod tests {
|
||||
"Should not be empty"
|
||||
);
|
||||
|
||||
// let uri = format!("{}/{}", crate::callers::endpoints::QUEUECOVERARTDATA, resp_coverart_id);
|
||||
|
||||
let raw_uri = String::from(crate::callers::endpoints::QUEUECOVERARTDATA);
|
||||
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);
|
||||
println!("Uri: {:?}", uri);
|
||||
|
||||
@@ -1294,18 +1290,6 @@ mod tests {
|
||||
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) => {
|
||||
assert!(false, "Error: {:?}", err);
|
||||
|
||||
Reference in New Issue
Block a user