Got things working
This commit is contained in:
+10
-8
@@ -239,12 +239,10 @@ pub mod endpoint {
|
|||||||
let mut response = super::response::fetch_metadata::Response::default();
|
let mut response = super::response::fetch_metadata::Response::default();
|
||||||
|
|
||||||
// TODO: Make sure id works as well
|
// TODO: Make sure id works as well
|
||||||
match (params.id, params.song_queue_id) {
|
match params.id {
|
||||||
(Some(id), Some(song_queue_id)) => {
|
Some(id) => {
|
||||||
println!("Something works {:?} {:?}", id, song_queue_id);
|
println!("Something works {:?}", id);
|
||||||
|
|
||||||
if !id.is_nil() {
|
|
||||||
println!("Id is not nil");
|
|
||||||
|
|
||||||
match super::metadata_queue::get_with_id(&pool, &id).await {
|
match super::metadata_queue::get_with_id(&pool, &id).await {
|
||||||
Ok(item) => {
|
Ok(item) => {
|
||||||
@@ -257,7 +255,10 @@ pub mod endpoint {
|
|||||||
(StatusCode::BAD_REQUEST, Json(response))
|
(StatusCode::BAD_REQUEST, Json(response))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
_ => {
|
||||||
|
match params.song_queue_id {
|
||||||
|
Some(song_queue_id) => {
|
||||||
println!("Song queue Id is probably not nil");
|
println!("Song queue Id is probably not nil");
|
||||||
match super::metadata_queue::get_with_song_queue_id(&pool, &song_queue_id).await
|
match super::metadata_queue::get_with_song_queue_id(&pool, &song_queue_id).await
|
||||||
{
|
{
|
||||||
@@ -272,11 +273,12 @@ pub mod endpoint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
None => {
|
||||||
_ => {
|
|
||||||
println!("What is going on?");
|
println!("What is going on?");
|
||||||
(StatusCode::BAD_REQUEST, Json(response))
|
(StatusCode::BAD_REQUEST, Json(response))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user