From 5c5c043adecefb14f023f3cd8dcbbcad20396e64 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sat, 28 Jun 2025 16:38:22 -0400 Subject: [PATCH] Tidying up and making some changes --- src/callers/song.rs | 4 +--- src/main.rs | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index c10293a..046c197 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -744,18 +744,16 @@ pub mod endpoint { let raw_data: Vec = data.to_vec(); match song_queue::update(&pool, &raw_data, &id).await { Ok(_) => { - response.subject = String::from("Successful"); + response.message = String::from("Successful"); response.data.push(id); (axum::http::StatusCode::OK, axum::Json(response)) } Err(err) => { - response.subject = String::from("Error"); response.message = err.to_string(); (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) } } } else { - response.subject = String::from("Error"); response.message = String::from("No data provided"); (axum::http::StatusCode::NOT_FOUND, axum::Json(response)) } diff --git a/src/main.rs b/src/main.rs index 472838c..ecb81f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -822,6 +822,9 @@ mod tests { resp.data.is_empty(), "Should not be empty" ); + + let updated_song_queued_id = resp.data[0]; + assert_eq!(updated_song_queued_id, *id, "Song queue Id should match, but they don't. {:?} {:?}", updated_song_queued_id, id); } Err(err) => { assert!(false, "Error: {:?}", err);