Update song queue changes #145

Merged
kdeng00 merged 5 commits from update_song_queue-changes into v0.2 2025-06-28 16:45:25 -04:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 5c5c043ade - Show all commits
+1 -3
View File
@@ -744,18 +744,16 @@ pub mod endpoint {
let raw_data: Vec<u8> = 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))
}
+3
View File
@@ -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);